getRunningAppProcesses returns empty list on Android M(5.1.1)

前端 未结 3 499
花落未央
花落未央 2021-02-03 10:34

I just tested my app and CM, ATM Android Assistant, etc. All of them can not get the running process list but they works fine on pre OS version. So what\'s going on with Androi

3条回答
  •  我在风中等你
    2021-02-03 10:59

    I could get foreground app list by using getRunningServices() method on android 6.0. Thanks @thecr0w

    ActivityManager mActivityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); List appProcessInfoList = mActivityManager.getRunningServices(Integer.MAX_VALUE);
    

提交回复
热议问题