Hi,

I am trying to be notified when the current task has gone to the 
background/foreground. Note that I am not asking about the current 
activity, or the current application, or about any other different task.

The context for this question is that, in my case, some resources should be 
freed when the task goes to the background (and only then). This can be 
implemented with onStart/onStop in my application's activities, but this is 
not possible when external activities are being used.

When we start an external activity with startActivityForResult (e.g. to 
pick a document or take a photo), Android places it on top of the current 
task's stack. However, there is apparently no way to get lifecycle 
callbacks from that new activity, even though it belongs to the same task 
as the rest of my application.

In other words, I haven't found a way to detect if the current task has 
gone to the background when the activity on top of the stack is external to 
my application.

Any ideas?

Thank you for your help.

Best,
Felipe


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/63f68b7a-4144-4946-a76a-96a854ab3995%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to