ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
ApplicationInfo appinfo = getApplicationInfo();
List<ActivityManager.RunningAppProcessInfo> run = am.getRunningAppProcesses();
for (ActivityManager.RunningAppProcessInfo runningProcess : run) {
if ((runningProcess.processName != null) && runningProcess.processName.equals(appinfo.processName)) {
Log.e("===========", String.valueOf(runningProcess.uid));
break;
}
}
android 开发获取应用uid 唯一标识
最新推荐文章于 2024-09-05 11:06:33 发布