Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to check to see if an activity is running or finished. Is there any method through which I can check the status of activity?

I found activity.isFinishing() but I am not sure about it.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
280 views
Welcome To Ask or Share your Answers For Others

1 Answer

If you want to perform any step before Activity is going to become invisible.

Their are several choices here.

onDestroy() - for final cleanup.

isFinishing() - right after act.finish() is called it will return true.

onStop() - when the Activity is killed by framework process. (not destroyed)

onPause() - when the Activity is covered by any other Activity

onBackPressed() - capturing the event of hardware Back key triggered by user.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...