title: Android: change style when focused
body: <p>I have this custom layout:</p>
  
  <pre><code>- LinearLayout
      - FrameLayout
          - ImageView
      - TextView
  </code></pre>
  
  <p>This layout reacts to click events (using <code>LinearLayout.setOnClickListener()</code>) and is made focusable using <code>android:focusable="true"</code> in the layout XML file. This all works fine if you're using the touchscreen, but I'm thinking about users who don't use the touchscreen that much and prefer navigation keys or maybe even don't have a touchscreen. These users won't be able to see when that <code>ViewGroup</code> is focused (although it <strong>can</strong> be focused using the keyboard).</p>
  
  <p>My question is: how can I make a change in that layout when it is focused (I need to change the <code>android:background</code> of the <code>ImageView</code>)? I suppose I could use <code>LinearLayout.setOnFocusChangeListener()</code>, but I'm thinking maybe there's a better way, using just XML files.</p>