tag:blogger.com,1999:blog-89878749563391212.post7956778115157133673..comments2024-03-25T17:53:11.127-07:00Comments on Android-er: Custom AlertDialog with EditText and ImageView, build with AlertDialog.BuilderUnknownnoreply@blogger.comBlogger1125tag:blogger.com,1999:blog-89878749563391212.post-21222265235245908652015-10-21T23:45:46.054-07:002015-10-21T23:45:46.054-07:00If your dialog is to large than the keyboard will ...If your dialog is to large than the keyboard will be behind it. To fix the problem I'm setting OnFocusChangeListener to the edit text and in the Manifest for the activity android:windowSoftInputMode="stateAlwaysHidden" to keep the keyboard hidden when closing the dialog.<br />Example :<br /> et.setOnFocusChangeListener(new View.OnFocusChangeListener() {<br /> @Override<br /> public void onFocusChange(View v, boolean hasFocus{ calendarDialog.getWindow().clearFlags(WindowManager<br />.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);<br /> calendarDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);<br /> <br /> InputMethodManager imm = (InputMethodManager)calendarDialog.getWindow().getContext().getSystemService(ctx.INPUT_METHOD_SERVICE);<br /> if(hasFocus)<br /> imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);<br /> }<br /> }<br /><br />I guess to escape that problem should use Dialog Fragment, but that is not the case.<br />Do you have any other solutions to that problem ?Anonymousnoreply@blogger.com