Application should not display in recent app list after finish the activity if app was not displaying recent app list previously

前端 未结 3 1125
时光说笑
时光说笑 2021-01-12 12:34

Step 1- Application is not exist in recent app list (App has been removed from recent app list).
Step 2- As soon as I got notification open IncomingCall activity, User a

3条回答
  •  走了就别回头了
    2021-01-12 13:04

    As per you needs, finishAndRemoveTask() is the new API that as per the documentation

    Finishes all activities in this task and removes it from the recent tasks list.

    if(android.os.Build.VERSION.SDK_INT >= 21)
    {
        finishAndRemoveTask();
    }
    else
    {
        finish();
    }
    

提交回复
热议问题