1

Is there any way to get the package name of the activity that is about to replace my activity? For example say I'm in my own application and I get an email, and I use the notification bar to open that application. Is there any way to identify the package name that is going to send my activity thread in Pause?

Thank you!

Taranasus
  • 515
  • 5
  • 12

1 Answers1

0

I don't think there is a simple and direct way of doing this since each Android application runs in a separate process. If your device is rooted you can workaround it.

Being said that, you actually doesnt know the name of any activity inside any application other than yours, unless the application exposes an interface to you. Usually, when the goal is to retrieve info from a package one uses PackageManager class, so have a peek at it, but like I said, I don't think it can be done if you are not root.

Nevertheless, take a look at this answer.

Community
  • 1
  • 1
kaneda
  • 5,981
  • 8
  • 48
  • 73
  • Well that's a shame but I think you're right. I'm going to start buying and reading some proper android books to stop posting so many god damn questions. Thank you very much kind sir or madam! – Taranasus Sep 18 '11 at 10:36
  • @Taranasus, It's not a shame, I'm also at the learning curve. Just trying to help. Continue studying and keep asking questions. We all learn from them! Good luck! – kaneda Sep 19 '11 at 15:03