简体   繁体   English

活动堆栈自动清除?

[英]activity stack auto clearing?

I have classes A, B, C, D; 我有A,B,C,D类; and they are done one after the other. 他们一个接一个地完成。 When i get to class D then hit the back button it goes to class B (class C i have as a not history in the manifest) but instead of staying on class B from D, it goes back to class A after about a second all by itself. 当我进入D类,然后单击“后退”按钮进入B类(清单中没有历史记录的C类),但不是停留在D类的B类,而是大约一秒钟后回到A类通过它自己。

why would it do that, how would you even debug something like that because the logcat does not say anything when it happens. 为什么要这样做,您怎么调试这样的东西,因为logcat在发生时什么也没说。

any suggestions? 有什么建议么?

I'd write some Log.d code like: 我会写一些Log.d代码,例如:

Log.d("MY_TAG", "Activity A, BC or D onCreate"); Log.d(“ MY_TAG”,“创建时进行活动A,BC或D”);

in every activity's onStart(), onCreate(), onResume(), onPause(), onStop() and on Destroy() 在每个活动的onStart(),onCreate(),onResume(),onPause(),onStop()和Destroy()中

Then filter the logcat on MY_TAG 然后在MY_TAG上过滤logcat

and see if that helps you track it down. 看看这是否有助于您进行追踪。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM