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_SERVICE);
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