Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Activity not showing in list of recent apps when launched from a widget

Tags:

android

I have created an app widget which, when clicked, launches an Activity in my application.

The activity it launches is NOT the main launcher activity (as set in the application manifest).

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

The activity I'm launching has launchMode="singleTop" (may be relevant)

If I launch the app from the app launcher, then press home and then the recent apps button, the app is there. I then remove the app from recent activities list or force close it.

If I then click on my widget, the activity launches fine. I then press Home and then the app does not appear in the list of recent apps.

Any ideas?

like image 451
JeffG Avatar asked Jul 05 '12 17:07

JeffG


People also ask

How do I turn on recent items on Android?

To open the recent apps overview, tap on the Home button, and then swipe upward. Make this swipe short (if you swipe too far, you'll open the App Drawer instead).

What is recents screen?

The Recents screen (also referred to as the Overview screen, recent task list, or recent apps) is a system-level UI that lists recently accessed activities and tasks. The user can navigate through the list and select a task to resume, or the user can remove a task from the list by swiping it away.


1 Answers

My activity was defined with flag android:excludeFromRecents="true" in the Manifest. Silly me, should've spotted that earlier. Removing that flag fixes the problem.

like image 139
JeffG Avatar answered Oct 05 '22 02:10

JeffG