Android的生命周期活动 [英] Android life cycle activities

查看:141
本文介绍了Android的生命周期活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  <一href=\"http://stackoverflow.com/questions/8515936/android-activity-life-cycle-what-are-all-these-methods-for\">Android活动生命周期 - ?什么是所有这些方法

我有一个活动是主要的名为 menuActivity 和其他活动,要求生日

I have an activity which is main called menuActivity and another activity which called birthDate.

当我运行应用程序的 menuActivity 成为活跃的一个,当我点击一个按钮,第二个成为活动其中一个是生日

When I run the application the menuActivity become the active one and when I click on a button the second one become the active one which is the birthDate.

我的问题是:

在第一个活动变得活跃另一项活动去的背景和主要活动涉及到forground,我必须执行哪种方法? OnResume 的OnCreate 还是什么?

When the first activity become active another activity goes to background and main activity comes to forground , which method do I have to implement ? OnResume or OnCreate or what?

推荐答案

onResume ..检查以下内容<一个href=\"http://developer.android.com/training/basics/activity-lifecycle/index.html\">http://developer.android.com/training/basics/activity-lifecycle/index.html

onResume.. check the following http://developer.android.com/training/basics/activity-lifecycle/index.html

这篇关于Android的生命周期活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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