Liza  Tjaica
Liza Tjaica

Reputation: 593

Android where to initialize activity data?

I want to do initialization when activity starts.

I can put it in onCreate method, but it is called every time screenOrientation is changed. I can disable this in AndroidManifest, but maybe there is better solution for this?

Upvotes: 0

Views: 1041

Answers (1)

Marcin Orlowski
Marcin Orlowski

Reputation: 75629

Please read this article about activities, including orientation change handling. In general reading about activity life cycle would also help you.

Upvotes: 2

Related Questions