private void showPasswordDialog(@StringRes int title,
final OnPasswordEnteredListener okListener,
final DialogInterface.OnClickListener cancelListener) {
// Create EditText for entering the password
final EditText input = new EditText(context);
input.setSingleLine();
input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
input.setTransformationMethod(PasswordTransformationMethod.getInstance());
// Create and show dialog
showDialog(new AlertDialog.Builder(context)
.setTitle(title)
.setView(input)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
okListener.onPasswordEntered(dialog, which, input.getText().toString());
}
})
.setNegativeButton(android.R.string.cancel, cancelListener));
}
PasswordDialog.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:TimberdoodleApp
作者:
评论列表
文章目录