[英]When the android Kill the app will onDestroy() method will be called first?
I am a beginner in Android and I want to know if i write some code in onDestroy()
method and the user open another app beside this now the onPause()
and onStop()
will be called correct?我是 Android 的初学者,我想知道我是否在
onDestroy()
方法中编写了一些代码并且用户打开了另一个应用程序,现在onPause()
和onStop()
将被调用正确吗? then if the android kill the app The onDestroy()
method will be called first or not??那么如果 android杀死应用程序
onDestroy()
方法将首先调用还是不调用?
As a user navigates through, out of, and back to your app, the Activity instances in your app transition through different states in their lifecycle.当用户浏览、离开和返回您的应用程序时,应用程序中的 Activity 实例会在其生命周期中经历不同的状态。 The Activity class provides a number of callbacks that allow the activity to know that a state has changed: that the system is creating, stopping, or resuming an activity, or destroying the process in which the activity resides.
Activity class 提供了一些回调,让 Activity 知道一个 state 发生了变化:系统正在创建、停止或恢复一个 Activity,或者销毁 Activity 所在的进程。
For this first, you need to understand the Activity Life Cycle how it actually works.首先,您需要了解 Activity Life Cycle 的实际工作原理。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.