I have an activity that has a SearchView directly above a ListView. The activity works by the user typing text in the SearchView which is then used to filter the content of the ListView.
On a 4" phone (Nexus 4) when the app is in "portrait" orientation and the user starts to input text in the search view, the lower half of the screen occupies the keyboard and the text is entered directly within the SearchView widget.
However, when the phone is in "landscape" orientation, the whole screen is occupied by the keyboard and a "text field" and the rest of the screen is lost. The "Search" button and the "Magnify glass" button on the keyboard seem to have no action.
See the screenshots
Question
Is it possible to have the text entered directly in the SearchView widget when in landscape orientation?
If not, how do I make the buttons on the keyboard do something?
You need to set your imeOptions for the SearchView widget, for example in the SearchableInfo xml:
android:imeOptions="actionSearch|flagNoExtractUi|flagNoFullscreen"
Similar can be achieved via setImeOptions if your not using xml to configure your search view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With