0

I use following code to display running process.This work fine below lollipop version, but in lollipop it doesn't work i have pasted code below. 1. Is google api is changed ? 2.Is method changed? 3.Is api is removed for higher version android Lollipop marshmallow or naugat

void main(){
textview = (TextView)findViewById(R.id.textView1);
context = getApplicationContext();
activitymanager = (ActivityManager)context.getSystemService(Context.ACTIVITY_S‌​ERVICE);
RAP = activitymanager.getRunningAppProcesses();
StringBuilder lStringBuilder = new StringBuilder();
for(ActivityManager.RunningAppProcessInfo processInfo: RAP ){
    lStringBuilder.append(processInfo.processName);

    lStringBuilder.append("\r\n");
}
textview.setText(textview.getText() + lStringBuilder + "\n");//Above code Only return my page name
  • textview = (TextView)findViewById(R.id.textView1); context = getApplicationContext(); activitymanager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE); RAP = activitymanager.getRunningAppProcesses(); for(ActivityManager.RunningAppProcessInfo processInfo: RAP ){ textview.setText(textview.getText() + processInfo.processName + "\n"); – gazi shaikh Sep 30 '16 at 03:36
  • 2
    Possible duplicate of [Android 5.1.1 and above - getRunningAppProcesses() returns my application package only](http://stackoverflow.com/questions/30619349/android-5-1-1-and-above-getrunningappprocesses-returns-my-application-packag) – Mike M. Sep 30 '16 at 03:38
  • Please [edit] your question to provide code. Please don't post it in comments. – Mike M. Sep 30 '16 at 03:39
  • This code only return my pakage name only – gazi shaikh Oct 22 '16 at 21:30

0 Answers0