My app offers a widget. User can add the widget to the home screen of his Android OS. When the user taps the widget my app gets opened.
The issue is: when run so, the app is not shown in the Recent Apps list.
How can I make my app to shown in the Recent Apps list regardless of how it was opened?
Here is the intent used to open the app:
Intent intent = new Intent(context, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
views.setOnClickPendingIntent(R.id.widget_contents, pendingIntent);
Here is the declaration of the activity in the app's manifest:
<activity
android:name=".MainActivity"
android:label="@string/title_activity_browse_playlist"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"
android:launchMode="singleTop">
</activity>