活动叠加 [英] activities stack

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

问题描述

有没有办法调试期间vizualise活动栈,在某个时刻,还是正常运行?

Is there a way to vizualise the activity stack, at some moment during debug, or normal run ?

推荐答案

您可以用活动管理一些有用的信息。

You can get some useful information with the activity manager.

ActivityManager         manager = (ActivityManager)getApplication().getSystemService( Activity.ACTIVITY_SERVICE );

此将告诉你在堆栈的顶部,底部和大小,和说明可能是有用的。你将不得不寻找正在运行的任务,找到当前活动。

This will show you the top, bottom and size of the stack, and description may be useful. You will have to search the running tasks to find the current activity.

RunningTaskInfo         task = manager.getRunningTasks( 10 ).get( 0 );
task.baseActivity();
task.numActivities();
task.topActivity();
task.description();

这有一个pkgLst方法可能会有所帮助。

This has a pkgLst method that may be helpful.

RunningAppProcessInfo   app = manager.getRunningAppProcesses().get( 0 );
app.pkgList();

不一样有用或简单,因为你所期望的,但它可能会有所帮助。

Not as useful or straightforward as you were hoping for, but it might help.

活动提供了getCallingActivity()方法,你可以添加到的onPause和onResume日志的建议了。

Activity provides the getCallingActivity() method that you could add to logs in onPause and onResume as suggested before.

还有如果(isChild())的getParent(); 的嵌入式活动

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

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