dialog中edittext自動彈出
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
//設置可獲得焦點
et_title.setFocusable(true);
et_title.setFocusableInTouchMode(true);
//請求獲得焦點
et_title.requestFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(et_title, InputMethodManager.SHOW_IMPLICIT);
}
});
跳轉newActivity 鍵盤彈出
mEt_info.setFocusable(true);
mEt_info.setFocusableInTouchMode(true);
mEt_info.requestFocus();
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
最后編輯于 :
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者