How to find back stack activities in an android application?

后端 未结 7 2076
不思量自难忘°
不思量自难忘° 2020-12-24 13:59

I have an application with activities back stack A -> B -> C -> D -> E. Now at activity E, I want to know the back stack activities that I navigated from. How do I find this

相关标签:
7条回答
  • 2020-12-24 14:38

    I think you can do it by listening to the changes of the activities, via this API of registerActivityLifecycleCallbacks :

    https://developer.android.com/reference/android/app/Application.html#registerActivityLifecycleCallbacks(android.app.Application.ActivityLifecycleCallbacks)

    https://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html

    This will help you to add to a stack of your own classes, and see the full state as you wish.

    0 讨论(0)
提交回复
热议问题