什么时候机器人完成的活动开始 [英] When does android activity finish starts

查看:169
本文介绍了什么时候机器人完成的活动开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们调用 activity.finish()将在未来的Andr​​oid生命周期的方法来执行?

When we call activity.finish() will the next android life cycle method be executed?

1),可以说,用户点击一个按钮
onUserInteraction()我们称之为 activity.finish()
将动作分派到按钮的 onClicked 监听器?

1) Lets say user clicks on a button
onUserInteraction() we have called activity.finish()
will the action dispatched to the onClicked listener of the button?

2)让说 ONSTART()我们称之为 activity.finish()
activity.OnResume()被称为?

2) lets say onStart() we have called activity.finish()
will activity.OnResume() be called?

推荐答案

在活动第一次加载的事件被称为如下:

When the Activity first time loads the events are called as below:

onCreate()
onStart()
onResume()

当您单击后退按钮或试图完成()活动的事件被称为如下:

When you click the back button OR try to finish() the activity the events are called as below:

onPause()
onStop()
onDestroy()

当你点击手机按钮的活动去后台和放大器;以下事件被称为:

When you click on Phone button the Activity goes to the background & below events are called:

onPause()
onStop()

退出电话拨号器和放大器;以下事件将被称为:

Exit the phone dialer & below events will be called:

onRestart()
onStart()
onResume()

我希望它现在很清楚,<一个href="http://stackoverflow.com/questions/8515936/android-activity-life-cycle-difference-between-onpause-and-onstop/8516056#8516056">for详情请参阅此。

这篇关于什么时候机器人完成的活动开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆