您好,登錄后才能下訂單哦!
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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。