Java – Android gets the PID of other applications

I want to be able to start an activity or service and get the PID of the process as soon as possible, which will be the best case Besides browsing the / proc directory, do I have any other options that can lead to a variable time race condition directory and start observation between the activity / service startup time and the time I need to find it in proc?

Solution

I think you need to use activitymanager: see http://developer.android.com/reference/android/app/ActivityManager.RunningAppProcessInfo.html Process information You can:

>Get all running application processes. > Find your application > get its PID

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>