This is my code
remove the parent layout (the RelativeLayout) and make the LinearLayout containing the dialog box only, the parent! plus, add android:windowSoftInputMode="stateVisible|adjustResize" to the AndroidManifest.xml
RelativeLayout
LinearLayout
android:windowSoftInputMode="stateVisible|adjustResize"
AndroidManifest.xml