Saturday 15 January 2011

java - Android, Learn about the application in the foreground -



java - Android, Learn about the application in the foreground -

i want know if possible know application in utilize user. currently, manage list of active processes on foreground unfortunately not isolate specific application ca taking applications in status bar.

here's use:

activitymanager activitymanager = (activitymanager) getsystemservice(context.activity_service); list<activitymanager.runningappprocessinfo> appprocesses = activitymanager.getrunningappprocesses(); (activitymanager.runningappprocessinfo appprocess : appprocesses) { if(appprocess.importance == activitymanager.runningappprocessinfo.importance_foreground) { log.d("executed app", "foreground " +appprocess.processname + "\t\t id: " + appprocess.pid); } }

here get:

11-09 18:12:56.645 8821-8821/company.test d/executed app﹕ foreground company.gillot.test id: 8821 11-09 18:12:56.645 8821-8821/company.test d/executed app﹕ foreground android.process.acore id: 30279 11-09 18:12:56.645 8821-8821/company.test d/executed app﹕ foreground com.android.phone id: 197 11-09 18:12:56.645 8821-8821/company.test d/executed app﹕ foreground scheme id: 97

anyone have idea? browse forums , android api far nil specific property.

bonus:

thereafter avoid detected applications "system".

thank in advance.

i think may mean check out link: how check current running applications in android? or http://androidexample.com/check_current_running_activity_%7c_task_%7c_application_-_android_example/index.php?view=article_discription&aid=111&aaid=133 hope helps these methods have used before.

java android process foreground

No comments:

Post a Comment