Simplest Android Activity Lifecycle

前端 未结 9 1323
礼貌的吻别
礼貌的吻别 2020-12-13 20:28

I noticed that the Android Developers Activity section has been updated since I started my app, but I am still unclear what the simplest Activity Lifecycle is.

As fa

9条回答
  •  孤街浪徒
    2020-12-13 20:44

    Android system is handling the lifecycle: i.e. instantiating activities and calling lifecycle methods. So I don't know what you mean by "destroy the activity". You, as a developer, have no such ability.

    Second, activity lifecycle flow can be sometimes confusing (I know I struggled with it at the beginning). So, just implement all lifecycle methods and put logging statements in them. Then try all real-life use cases (including receiving a call during app use) to see how lifecycle methods are called.

提交回复
热议问题