I have an AppCompatAutoCompleteTextView
at the bottom of a DialogFragment
.
On tablet (API 19) in landscape mode the dropdown is covered by the keyboard when there is only one element in the suggestion list. When there are more elements, the dropdown goes upwards, and works fine.
On mobile (API 22), there aren't any problems even when there's only one element in the suggestion list, the dropdown is always shown upwards.
I've already added android:windowSoftInputMode="adjustPan|stateHidden"
to the activity in the Manifest.
How can I make the dropdown always go upwards or not to be covered by the keyboard?
hideSoftInputFromWindow returns true when keyboard is closed else false. So in first back press it'll close keyboard and in second back press it'll go in if condition and dismiss dialog there