80,351
社区成员
发帖
与我相关
我的任务
分享
<EditText android:id="@+id/password" android:layout_height="wrap_content"
android:password="true" android:layout_width="fill_parent"
android:textSize="18sp">
</EditText>
mEtPassword = (EditText)findViewById(R.id.password);
mBtnPassword = (Button)findViewById(R.id.btnPassword);
mBtnPassword.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Log.d("AndroidTest", "mbDisplayFlg = " + mbDisplayFlg);
if (!mbDisplayFlg) {
mEtPassword.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
} else {
mEtPassword.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
mbDisplayFlg = !mbDisplayFlg;
mEtPassword.postInvalidate();
}
});
mEtPassword = (EditText)findViewById(R.id.password);
mBtnPassword = (Button)findViewById(R.id.btnPassword);
mBtnPassword.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mEtPassword.setInputType(InputType.TYPE_CLASS_TEXT);
mEtPassword.postInvalidate();
}
});