pwd = (EditText) findViewById(R.id.e1);
Button btn = (Button) findViewById(R.id.b1);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(pwd.getInputType()==128){
pwd.setInputType(129);
}else{
pwd.setInputType(128);
}
pwd.postInvalidate();
Spannable text=pwd.getText();
Selection.setSelection(text, text.length());
}
});
Button btn = (Button) findViewById(R.id.b1);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(pwd.getInputType()==128){
pwd.setInputType(129);
}else{
pwd.setInputType(128);
}
pwd.postInvalidate();
Spannable text=pwd.getText();
Selection.setSelection(text, text.length());
}
});