有沒有辦法在dialog顯示的時候,不讓鍵盤自動顯示?
對話框代碼如下:
final Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.shopping_cart_confirm_dialog);
TextView txtConfirmEmail = (TextView)dialog.findViewById(R.id.txtConfirmEmail);
...
dialog.show();
試試:
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);