Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SearchView and keyboard

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 screenshotsenter image description here

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?

like image 532
BENBUN Coder Avatar asked Mar 08 '13 14:03

BENBUN Coder


1 Answers

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.

like image 180
CCRoss Avatar answered Oct 20 '22 15:10

CCRoss