Is that possible to check was onCreate called because of orientation change?

后端 未结 8 1481
甜味超标
甜味超标 2020-12-06 00:08

I need to act differently in onStart() method depending on how onCreate() was called in result of orientation change or not. Is that

8条回答
  •  情深已故
    2020-12-06 00:49

    Try getChangingConfigurations. Use this to discover when the activity is being destroyed because of an orientation change, set a flag, and check that flag when onCreate is called.

    This has the advantage of letting you know why the activity is restarting without overriding orientation configuration in the manifest.

提交回复
热议问题