0

I'm using an android search dialog in my app, and it works fine in Portrait orientation. But as soon as you flip to landscape orientation the searchpage xml appears to be covered by a large white dialog box. If you do a search, the box is still there, and you hit the back button on the device or emulator, the large white box slides away and there are your search results. It seems like somehere in the code a layout width is set to fill_parent or something. I've looked around for a solution and someone suggested adding android:imeOptions="flagNoExtractUi" to seachable.xml in the xml folder, but that doesn't seem to have any effect.

I've discovered that it's the onSearchRequested(); method that is throwing up that white box that fills the screen. And it also may have something to do with the fact that the software keyboard isn't called when in landscape, vertical orientation.

1 Answer 1

0

You could create your own Dialog in the form of an Activity. You do that like this:

 <activity
    android:theme="@android:style/Theme.Dialog"
    android:configChanges="keyboardHidden|orientation|screenSize"
    android:name="ExampleActivity" >
 </activity>

This Activity can of course be arranged any way you like via the XML. This way, you can gracefully handle the change from portrait to landscape.

Note: You only need the "screenSize" attribute if you are using ICS (14+).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.