开发者

Switching between portrait and landscape resets to screen 0

I'm using the T-Mobile G1. What I have is a 3 tab app(that is based on the example of the TAB APP). Whenever you switch between portrait and landscape by opening/closing the keyboard,

(1)the screen(s) do not scroll and,

(2)if you are on screen 1 or 2 and开发者_运维百科 open/close the keyboard, the app will reset to screen 0.

I have no idea how to fix the error or where to look for the solution.


By default, when the screen rotates your activity is destroyed and recreated in the new orientation. See Configuration Changes for details.

This means that your activity needs to properly save its state in onSaveInstanceBundle and restore it in onCreate.


to avoid the situation that Mayra describes, define the property

android:configChanges="keyboardHidden|orientation"

in your activity inside in your Manifest.xml

     <activity android:name="myActivity"            
...
...
              android:configChanges="keyboardHidden|orientation"        
        /> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜