title: Android imageview touch listener not working
body: <p>Help me guys , My Imageview touch listener not working.</p>
  
  <pre><code>       imgShowNewAgain.setOnTouchListener(new View.OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              switch (event.getAction()) {
                  case MotionEvent.ACTION_DOWN:
                      cstmEdtNewPasswordAgain.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
                      break;
                  case MotionEvent.ACTION_UP:
                      cstmEdtNewPasswordAgain.setTransformationMethod(PasswordTransformationMethod.getInstance());
                      break;
                  default:
                      break;
              }
              return true;
          }
      });
  </code></pre>
  
  <p>and my XML Code is </p>
  
  <pre><code>     &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:gravity="center"
                  android:orientation="horizontal"
                  android:weightSum="1"&gt;
                  &lt;com.CustomEditText
                      android:id="@+id/cstmEdtNewAgain"
                      style="@style/label_text_primary"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_weight="0.1"
                      android:backgroundTint="@color/not_black_more"
                      android:hint="@string/new_password"
                      android:paddingBottom="@dimen/normal_padding"
                      android:paddingLeft="@dimen/most_min_padding"
                      android:paddingRight="@dimen/most_min_padding"
                      android:paddingTop="@dimen/normal_padding"
                      android:typeface="normal"
                      android:singleLine="true"
                      android:maxLines="1"
                      android:inputType="textPassword"
                      android:textCursorDrawable="@drawable/cursor_color"
                      app:font="@string/montserrat_regular"
                      tools:targetApi="lollipop" /&gt;
                  &lt;ImageView
                      android:id="@+id/imgShowNewAgain"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_weight="0.9"
                      android:clickable="true"
                      android:contentDescription="@string/showpasswordAgain"
                      app:srcCompat="@drawable/show" /&gt;
              &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Help will be appreciated. </p>
  
  <p><strong>I have updated complete XML layout. The only layout iam  having is above xml. and i have initialize the layout and create the touchlistener for the Imageview. but event it is not working. i dont know where i made the mistake. or  is there need to add some additional information on xml file. like , focusable=false etc..</strong></p>