安卓活动的$ P $后生命周期pssing后退按钮 [英] Life cycle of Android Activity after pressing Back button

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

问题描述

我是两个活动的生命周期之间有点糊涂了。

I am little confused between the life cycle of two activities.

假设我有活动A和b活动。

Suppose I have Activity A and Activity B.

B称为从即 A ---->乙

现在目前 B 是在屏幕上,我pressed后退按钮。在这里,我想知道: - 没有任何记忆仍然可用于 B (活动)或 B 的内存被刷新(未激活)。

Now currently B is on the screen and I pressed back button. Here I want know:- is there any memory still available for B(Active) or B's memory is flushed(Inactive).

它我对Android的第三个星期。

Its my third week on android.

推荐答案

假设有活性的,比你跟活动B和比你会打的后退按钮比它意味着你弹出堆栈和B不会再出现在活动的堆栈。

suppose there is an activity A and than you come with activity B and than if you will hit the back button than it means you are popping up the stack and B will not be there anymore in the activity stack .

当你正在推​​动的活动,以堆叠方式的onCreate 会打电话,如果你preSS后退按钮,的onDestroy 将被调用,这意味着活动冲走。

whenever you are pushing an activity to stack means onCreate will call and if you press back button, onDestroy will be called which means that activity is flushed away.

请访问我的博客

<一个href="http://upadhyayjiteshandroid.blogspot.in/2013/02/android-lifecycle.html">http://upadhyayjiteshandroid.blogspot.in/2013/02/android-lifecycle.html

请访问更多的

please visit for more

<一个href="http://developer.android.com/guide/components/tasks-and-back-stack.html">http://developer.android.com/guide/components/tasks-and-back-stack.html

<一个href="http://developer.android.com/training/basics/activity-lifecycle/starting.html">http://developer.android.com/training/basics/activity-lifecycle/starting.html

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

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