I am creating an application which will give me currently running task , it is working perfectly bellow 5.1 Lollipop
this is my code for bellow 5.1
mPackageName = ActivityManager.getRunningTasks(1).get(0).topActivity.getPackageName();
(I want only single application which is currently running)
but in 5.1 it is not giving me the right package
this code is running every 1 second. Please give me some suggestions
Thanks Amit