I\'m a newbie with android, I write an application which using the Dialog to display data when user select on one thing. This is how the dialog looks:
https://docs.googl
Have you tried ths one?
Worked for me:
http://developer.android.com/reference/android/view/Window.html#setSoftInputMode(int).
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
You may need to set dialog's width and height manually in order to make soft input mode work like this:
WindowManager.LayoutParams params = window.getAttributes();
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.height = WindowManager.LayoutParams.MATCH_PARENT;
params.gravity = Gravity.CENTER;
window.setAttributes(params);
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE );
AlertDialog dialog = new AlertDialog.Builder(this).create();
dialog.show();
Window window = dialog.getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
create a Xml file name style.xml
<style name="FullHeightDialog" parent="android:style/Theme.Dialog">
<item name="android:windowNoTitle">true</item>
<item name="android:windowSoftInputMode">stateUnchanged</item>
<item name="android:windowBackground">@color/dialog_transparent</item>
</style>
then Implement
this works for me hoping it will work for you also.
final Dialog dialog = new Dialog(this , R.style.FullHeightDialog);
and also do changes in your manifest file
android:windowSoftInputMode="adjustResize|adjustPan"