0

I was trying to get all running apps on my phone, I use below code to get Running processes,

 List<ActivityManager.RunningAppProcessInfo> runningList= am.getRunningAppProcesses();
      if(runningList!=null && runningList.size()>0){
          Log.d("List Size",""+runningList.size());
      }

But the list contains only one app process in Nexus4 and Moto G which running 5.1 OS, But when i tested the same on Sony Z 5.0 os and emulator it showing the right list(70 in Sony z and 16 in emulator).

Why in nexus4 it not listing all the running process.

SGCB
  • 11
  • 1
  • 4
  • They probably tightened this down for privacy and security reasons. – CommonsWare Sep 11 '15 at 11:12
  • @CommonsWare, maybe, is there any other way to get running process, in one of my other post [link](http://stackoverflow.com/questions/32453283/how-to-get-value-of-mlaunchcount-from-usagestats-api-class) i was able to get mLaunchCount using java reflection, but the field not giving the proper count. – SGCB Sep 11 '15 at 11:29
  • It works fine in my Nexus 4 running 5.1OS.. – shhp Sep 11 '15 at 11:53
  • @shhp will you share your part of code? My code is working on 5.1 emulator and in sony but not on the nexus and moto g. – SGCB Sep 14 '15 at 04:32
  • The code is same as yours. – shhp Sep 14 '15 at 05:20
  • @shhp, ok... thanks. – SGCB Sep 14 '15 at 05:27

0 Answers0