Hi,
I am using the following code to remove the application from the recent apps list:
if (android.os.Build.VERSION.SDK_INT >= 21) {
ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
if (am != null) {
am.clearApplicationUserData();
am.killBackgroundProcesses(getPackageName());
List<ActivityManager.AppTask> tasks = am.getAppTasks();
if (tasks != null && tasks.size() > ZERO) {
for (ActivityManager.AppTask appTask : tasks) {
appTask.finishAndRemoveTask();
}
}
}
finishAndRemoveTask();
}
Code is working as aspected with Clover mini second generation because the clover mini second generation has the android version > 21.
But in the clover mini first generation, we are unable to remove the application from recent list.
Can you please suggest a way to remove the application from the recent list which is also supported by Clover mini first-generation device?
Thanks.