开发者

How to get my android app "User" at runtime?

i want to find a process that was inv开发者_如何学编程oked by my application. And when i use "ps pgrep -u" i need my application "User" id.

How can i get it on runtime?

thanks!


See http://developer.android.com/reference/android/os/Process.html.

EDIT: you can also use to http://developer.android.com/reference/android/app/ActivityManager.html#getRunningAppProcesses%28%29 get http://developer.android.com/reference/android/app/ActivityManager.RunningAppProcessInfo.html. You can then find your process in the mix and access your user id.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜