I am working on push notification in android where i am using a below method to show notification, but the problem is that now ActivityManager.getRunningTasks(1); is being
This should help you get started
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); List tasks = activityManager.getAppTasks(); for (ActivityManager.AppTask task : tasks) { Log.d(TAG, "stackId: " + task.getTaskInfo().stackId); }