弹出验证本机密码android

时间:2015-08-16 14:56:15

标签: android

我希望用户类型为密码,然后按确定按钮,然后检查这是否真的是设备的密码。如果它是这样应用程序将关闭,如果没有弹出再试一次。

  new MaterialDialog.Builder(Finished.this)
                    .title("To exit enter your phone password")
                    .inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD)
                    .positiveText(R.string.ok)
                    .negativeText(R.string.cancle)
                    .input(R.string.input_hint, Integer.parseInt(""), new MaterialDialog.InputCallback() {
                        @Override
                        public void onInput(MaterialDialog dialog, CharSequence input) {
                            // Do something
                        }
                    })
                    .callback(new MaterialDialog.ButtonCallback() {
                        @Override
                        public void onPositive(MaterialDialog dialog) {
                            onBackPressed();
                        }
                    })
                    .show();

0 个答案:

没有答案