title: Android On Focus Listener and On Click Listener on ImageView
body: <p>I have an imageview - It has both the attributes -<strong>focusable</strong> and <strong>focusableintouchmode</strong> set to <strong>true</strong>
  <br/></p>
  
  <pre><code>&lt;ImageView
          android:id="@+id/ivMenu01"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:focusable="true"
          android:focusableInTouchMode="true" &gt;
      &lt;/ImageView&gt;
  </code></pre>
  
  <p>I have implemented the <strong>onFocusChangeListener</strong> in my activity-</p>
  
  <p><br/></p>
  
  <pre><code> @Override
  public void onFocusChange(View v, boolean hasFocus) {
      switch (v.getId()) {
      case R.id.ivMenu01:
  
              if (hasFocus) {
                  ivMenu01.setImageBitmap(Utility
                          .getBitmap("Home_ford_focus.png")); // Focussed image
              } else {
                  ivMenu01.setImageBitmap(Utility.getBitmap("Home_ford.png")); // Normal image
              }
  
          break;
  
      default:
          break;
      }
  
  }
  </code></pre>
  
  <p>Also the <strong>onClickListener</strong> - 
  <br/></p>
  
  <pre><code> case R.id.ivMenu01:
                  ivMenu01.requestFocus();
                  Intent iFord = new Intent(HomeScreen.this, FordHome.class);
                  startActivity(iFord);
  
  break;
  </code></pre>
  
  <p>Now when i click the ImageView the first click gives the focus to the ImageView and the second click performs the action.
  I am not sure why this is happening . <br/>
  The first click should request focus as well as perform the action.<br/>
  Any help on how to do this will be highly appreciated.<br/></p>