Clear all recent tasks Programmatically

前端 未结 4 1832
别跟我提以往
别跟我提以往 2020-12-11 23:27

I am trying to remove all recent tasks through a program. Before posting a question, I googled it, but no luck at all.

I tried to use ActivityManager.killBackg

相关标签:
4条回答
  • 2020-12-11 23:46

    I just met with the same problem. My duty was to remove a 3th party app from recent list.

    Okay, I don`t know how clear the recent list, but I know, how not to put your app there. start it with: FLAG_ACTIVITY_NO_HISTORY flag .

    This worked for me, I hope I can help with it for you. details: min SDK level 14

    Cheers,

    0 讨论(0)
  • 2020-12-11 23:51

    REMOVE_TASKS is a signature-level permission. It can only be held by apps written by the developers of the device firmware, such as a device manufacturer or ROM mod author.

    0 讨论(0)
  • 2020-12-11 23:56

    Try this out in android manifest inside the launcher activity:

     android:excludeFromRecents="true"
    
    0 讨论(0)
  • 2020-12-12 00:00

    In your AndroidManifest.xml, you need to add this:

    uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"
    
    0 讨论(0)
提交回复
热议问题