most of my application will not look so well on landscape, but that's the user choice as far as i'm concerned if to see the application on 'wide' screen. However i have an auto complete screen and that screen cannot function in landscape mode since when user input text and i bring the results into the list view on screen the user can't see the listview since t开发者_开发知识库he virtual keyboard covers it all. So i thought of defining in the manifest that this activity wont be used in landscape, but i CAN use it in landscape mode for devices with hardware keyboard that is open...
So either i can define it in the manifest (couldn't find how) or i need to do it melodramatically (discover the keyboard existence and open to support it, or disable the rotation otherwise).
Anyone knows how to do that ?:
You can try
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
OR
activity android:name=".SomeActivity" android:screenOrientation="portrait"
these may help you.
you can also intercept these config changes:
<activity ...
android:configChanges="orientation|keyboardHidden">
</activity>
and in onConfigurationChanged()
you can decide what to do with them.
精彩评论