Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 accept the call.
Step 3- User click on disconnect button finish the IncomingCall activity.

Problem- Application showing in recent app list even app was not in recent app list previously.

Manifest entry

<activity
android:name=".activities.IncomingCall"
android:excludeFromRecents="true"
android:launchMode="singleTop"
android:screenOrientation="portrait" >
</activity>

In the activity using

public void onClick(View v) {
switch (v.getId()) {
case R.id.onCallDisconnectButton:
phoneCallBaseClass.disconnect();
IncomingCall.this.finish();
break;
  }
}

And also I have tried below link but it will work when app already exist in background

Remove app from recent apps programmatically

OR Is there any other way to show incoming call view So that it will not persist in history.

you can take example of any VoIP calls app-

Remove app from recent app list after that incoming call came, user disconnect the call activity(IncomingCallActivity) would not be exist in recent app list. But in My case activity persist in recent app list after disconnecting the call.

Thanks

like image 849
Ajit Kumar Dubey Avatar asked Jul 29 '15 07:07

Ajit Kumar Dubey


People also ask

Why my recent apps are not showing?

So, restart your device and check if the Recents button started working. If the issue persists, check the navigation settings and make sure and enable/disable Buttons. This might be a temporary system bug and disabling and re-enabling on-screen buttons in Navigation settings should fix the problem. 2.

How do I turn on recently used apps?

You'll be able to see your recent apps with a single tap. From the Home screen, tap the Recents icon to the left of the Home button. All of your active or opened apps will be listed. If you've customized your Navigation bar, Recents may be located on the right, unless you're using full screen gestures.


1 Answers

Add

android:excludeFromRecents="true" 

to the activity tag of your launcher activity in AndroidManifest.xml file

<activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:excludeFromRecents="true">
....
</activity>
like image 145
Saurav Ghimire Avatar answered Nov 07 '22 09:11

Saurav Ghimire