如何检测是否从儿童活动中回来? [英] How to detect if came back from child activity?

查看:49
本文介绍了如何检测是否从儿童活动中回来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在按下子活动中的后退"按钮后检测活动是否成为焦点,以及如何在那时执行一些代码?

How can I detect if an activity came to focus after pressing the back button from a child activity, and how can I execute some code at that time?

推荐答案

您正在寻找的方法可能是可以在您的母类中实现的onResume方法;).您必须知道onResume在您首次启动任何活动时也被称为.查看活动的生命周期: http://developer.android.com/images/activity_lifecycle.png

The method you're looking for may be the onResume method you can implements in your mother class ;). You must know that the onResume is also called the first time you launch any activity. Look at the lifecycle of an activity : http://developer.android.com/images/activity_lifecycle.png

此致

这篇关于如何检测是否从儿童活动中回来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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