I have dialog which has a EditText get overlapped by the soft input keyboard.I've tried all posts i could like
dialog.getWindow().setSoftInputMode(ADJUST_RESIZE)
and set theme for dialog but neither of them work. I think my Fullscreen Activity has changed something but I have no idea what it is
View layout= LayoutInflater.from(context).inflate(R.layout.add_bookmark_dialog_layout,null);
final EditText note=(EditText)layout.findViewById(R.id.bookmark_note);
TextView page= (TextView)layout.findViewById(R.id.bookmark_page);
TextView file=(TextView)layout.findViewById(R.id.bookmark_file);
page.setText(String.valueOf(currentPage));
file.setText(fileName);
AlertDialog.Builder builder=new AlertDialog.Builder(context).setView(layout).setTitle("Add New Bookmark").setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Bookmark newBookmark= db.addBookmark(currentPage,note.getText().toString(),fileName);
adapter.add(newBookmark);
}
}).setNegativeButton("Cancel",null);
AlertDialog dialog=builder.create();
//Not working : dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
dialog.show();
Here my AndroidManifest.xml
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
//where dialog pop up
<activity
android:name=".ReadingActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_reading"
android:parentActivityName=".MainActivity"
android:theme="@style/FullscreenTheme"></activity>
</application>