Using finishAndRemoveTask() method of Activity class on API levels lower than 21
Asked Answered
B

2

8

I need to delete app from recently used apps list. There is no problem on API level 21 and above. I use finishAndRemoveTask() method. But that method cannot be used on API levels lover than 21. How can I call that method on API levels lover than 21?

I tried that solutions but they does not work :

Close application and remove from recent apps/

Bianco answered 25/11, 2016 at 9:51 Comment(0)
B
1

I solved the problem with that library :

https://github.com/Ereza/CustomActivityOnCrash

Bianco answered 12/12, 2016 at 8:14 Comment(0)
T
3

Prease, check code below

    if (Build.VERSION.SDK_INT >= 21)
        finishAndRemoveTask();
    else
        finish();
    System.exit(0);
Townsville answered 21/2, 2017 at 14:27 Comment(0)
B
1

I solved the problem with that library :

https://github.com/Ereza/CustomActivityOnCrash

Bianco answered 12/12, 2016 at 8:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.