Android application that display the notification for any application start or Stop. I want code for it -
my code broadcast recevier
broadcastreceiver allapp = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { if (intent.getaction().equalsignorecase(intent.action_all_apps)){ log.i("appname", "changes in applications"); } } };
hi below sample code getting application has been started(user using)
activitymanager = (activitymanager) getsystemservice(context.activity_service); list runningtask = .getrunningtasks(4);
activitymanager.runningtaskinfo ar = runningtask.get(0); activitymanager.runningtaskinfo br = runningtask.get(1); ar.topactivity.tostring(); classname = ar.topactivity.getclassname().tostring(); packagename = ar.topactivity.getpackagename().tostring();
put code in timestask , package name , class name used user.
activitymanager.runningtaskinfo br = runningtask.get(1); give task has been stoped or went ground.
Comments
Post a Comment