Skip to content

Instantly share code, notes, and snippets.

@kingargyle
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingargyle/c23624f26b4c9b384f79 to your computer and use it in GitHub Desktop.
Save kingargyle/c23624f26b4c9b384f79 to your computer and use it in GitHub Desktop.
Resize Dialog for Soft Keyboard input with Text Views
/**
* Make sure that the Dialog size adjusts when the softlkeyboard is displayed.
*/
alertDialog.getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
/**
* Over ride onCheckIsTextEditor to always make sure the Webview
* brings up the softkeyboard when in an input field. There
* are situations like in a Dialog where the Softkeyboard will
* not display.
*/
WebView newWebView = new WebView(webView.getContext()) {
@Override
public boolean onCheckIsTextEditor() {
return true;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment