I am encountering a problem that i can\'t not solve for the moment. The purpose of the code is to monitor which applications are running at current moment. I used the fo
replace the "Activity" in getSystemService's parameters with "Context":
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
I tested it and works fine for me!