开发者

Orientation change and onCreate method in Android

开发者 https://www.devze.com 2023-02-27 00:11 出处:网络
Every time when orientation changes, it always calls the onCreate method. Is it possible to bypass the onCreate method after orientation changed ?

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

精彩评论

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