user403015
user403015

Reputation: 7227

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 refresh or redraw the current view only without calling onCreate again. How to do that ?

Thanks.

Upvotes: 2

Views: 3704

Answers (1)

Michael
Michael

Reputation: 54725

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.

Upvotes: 5

Related Questions