title: How to hide and show password on button click in android?
body: <p>When button pressed want to visible the password otherwise it should be hidden or say dotted.
         I have Applied the following code but its not working.
  Any help would be appreciated.             </p>
  
  <pre><code> button.setOnTouchListener(new View.OnTouchListener() {
          @Override
          public boolean onTouch(View view, MotionEvent motionEvent) {
              if(button.isPressed()) {
                  upass.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
                  return true;
              }
              return true;
          }
     });
  </code></pre>