Thursday, April 24, 2014

Jijiji ...... how to judge an Activity is not in operation? ? ?


As the title ...... I have a timer, 10 seconds to start an Activity, and now want to determine, if not then, then you start running, if not running, then it starts Activity. All starts with an Activity.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Activity attributes that you set in AndroidManifest.xml inside: android: launchMode = "singleInstance"
Reply:
You're running, it should be activity in the foreground it
By ActivityManager of getRunningTasks, the first task of the judge is not what you are looking for topActivity activity can
Reply:
reference to the second floor of the reply:
you say running, should be the activity in the foreground it
By ActivityManager of getRunningTasks, the first task of the judge is not what you are looking for topActivity activity can

+1
Reply:
cited a floor reply:
Activity attributes that you set in AndroidManifest.xml inside: android: launchMode = "singleInstance"

+1 Do not forget to add permissions XML inside oh
Reply:
Nothing their play ......
Reply:
There is a better way ah, isTaskRoot () This method is to determine the activity is not in the top level

No comments:

Post a Comment