溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

彈出一個密碼對話框,可以顯示和隱藏密碼

發(fā)布時間:2020-07-20 06:23:00 來源:網(wǎng)絡(luò) 閱讀:405 作者:671076656 欄目:開發(fā)技術(shù)

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;

}


向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI