private String strPsd = null;
private EditText edtPsd = null;
private CheckBox check = null;
// 弹出输入Wifi密码框
public String showPasswordDialog(int position) {
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.check_psd,
(ViewGroup) findViewById(R.id.check_layout));
edtPsd = (EditText) layout.findViewById(R.id.editText1_check);
check = (CheckBox) layout.findViewById(R.id.checkBox1_check);
check.setTextColor(Color.WHITE);
new AlertDialog.Builder(this)
.setView(layout)
.setMessage(R.string.inputpsd)
.setNegativeButton(R.string.cancel,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int which) {
}
})
.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int which) {
}
}).show();
check.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
// TODO Auto-generated method stub
if(check.isChecked()){
edtPsd.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
}else{
edtPsd.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
}
}
});
return strPsd;
}
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。