You can do it the other way around - have your activity do something upon
successful completion. See startActivityForResult.

14 мая, 2010 11:27 AM пользователь "Lee" <[email protected]>
написал:

I have a service which starts an activity and waits for it to finish
before proceeding.

It's not reliable to check using the Android API if the activity is
still running, so I'm using a static variable as a flag.

If the activity is somehow exited before it can set the flag, I've got
big problems.

Currently I'm trying:

onUserLeaveHint() {
   super.onUserLeaveHint();
   userLeaveHintFlag = true;
}

onPause() {
   super.onPause();
   if ( isFinishing() || userLeaveHintFlag )
         setExitVar();
}

onPause() is guaranteed to be called when the activity is killed
according to the docs. However, if isFinishing() is not set that
doesn't help me.

Lee

On May 13, 8:43 pm, Moto <[email protected]> wrote: > What exactly are
you trying to do?

-- You received this message because you are subscribed to the Google Groups
"Android Developers" g...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to