title: Hide a layout when focus on it is lost in XML
body: <p>I have the following xml file: <br/> </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/FrameLayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
  &lt;android.support.v4.view.ViewPager
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/pager"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      &gt;
  &lt;/android.support.v4.view.ViewPager&gt;
  
  &lt;LinearLayout
      android:id="@+id/musicLayout"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="bottom"
      android:gravity="center"
      android:orientation="horizontal"
      android:padding="10dp"
      android:focusable="true"
      android:visibility="visible" &gt;
  
      &lt;ImageView
          android:id="@+id/backward"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:src="@drawable/backward" /&gt;
  
      &lt;ImageView
          android:id="@+id/stop"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:paddingLeft="8dp"
          android:src="@drawable/stop" /&gt;
  
      &lt;ImageView
          android:id="@+id/pausePlay"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:paddingLeft="8dp"
          android:src="@drawable/play" /&gt;
  
      &lt;ImageView
          android:id="@+id/forward"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:paddingLeft="8dp"
          android:paddingRight="10dp"
          android:src="@drawable/forward" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>The framelayout is for an actionbar with tabs which are the viewpager in the above layout. The actionbar works perfect. The problem that I want to solve is that the last linearlayout, which is actually a media player floating in the bottom of the screen, needs to be hidden when I press outside the linearlayout! I have tested the <a href="/questions/tagged/onfocuschangelistener" class="post-tag" title="show questions tagged 'onfocuschangelistener'" rel="tag">onfocuschangelistener</a> in the musicLayout and <a href="/questions/tagged/onclick" class="post-tag" title="show questions tagged 'onclick'" rel="tag">onclick</a> in the pageviewer but nothing happens! What am i doing wrong? <br/>
  Edit: <br/>
  In case it helps, every tab is a fragment with its own layout which is added to the viewPager.</p>