开发者

Orientation change and onCreate method in Android

Every time when orientation changes, it always calls the onCreate method.

Is it possible to bypass the onCreate method after orientation changed ?

I want to r开发者_运维技巧efresh or redraw the current view only without calling onCreate again. How to do that ?

Thanks.


Yes, it's possible. You can add attribute android:configChanges="orientation" to your activity declaration in AndroidManifest.xml. This can be done if your activity doesn't change its layout when orientation changes.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜