Starting the app from Notification remove it from recent app history

后端 未结 5 1533
逝去的感伤
逝去的感伤 2021-02-12 23:04

I have a problem in one of my apps when I start it from a notification. It never appears in the \"recent app\" list.

Without notifications, every thing works as expected

5条回答
  •  余生分开走
    2021-02-12 23:32

    I bumped into same issue. The problem was that my activity had android:label="". When I open Activity from the Notification then it replaces root activity in the app task with current one. And Android excludes activities with empty label from Recents (see source code).

    To hide title of activity you should use:

    getActionBar().setDisplayShowTitleEnabled(false);
    

提交回复
热议问题