-4

I am unable to understand why this is happening. Application was not in background. Incoming call came user receive the call after disconnecting call application showing in recent app list even I have applied this attribute android:excludeFromRecents="true"

I have tried

Intent.FLAG_ACTIVITY_NO_HISTORY

and

android:noHistory="true" and android:excludeFromRecents="true"

ExcludeFromRecent working when app running in background but still is not working when app is not in background.

Ajit Kumar Dubey
  • 1,383
  • 1
  • 19
  • 33
  • @Sebastian can you give me proper solution, just tried to remove app from background then applied that property you can check what would be happened. – Ajit Kumar Dubey Aug 05 '15 at 10:19
  • i do not know any other solution as i told in the other post. Sorry!. Exclude from recents is what you should look at – Raghunandan Aug 05 '15 at 13:31
  • @Raghunandan Same in other post. Nobody gave me solution that's why I posted here again. if you want any clarification please let me know. Still I am not able to find any solution. – Ajit Kumar Dubey Aug 05 '15 at 13:37
  • AFAIK you should be using exclude from recents. Why don't you try posting on google groups android developer forum you might get an answer from googler.. – Raghunandan Aug 05 '15 at 13:39

2 Answers2

0

If you do not want your activity to be listed in recents, you should add android:excludeFromRecents="true" to your activity entry in manifest file.

Docs: https://developer.android.com/guide/topics/manifest/activity-element.html#exclude

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
0

when you want to have special properties for an Activity when starting it you supply special flags to the Intent. In this case FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS.

Updated:

If you need to hide the current already running activity, you might be able to use this flag in combination with FLAG_ACTIVITY_CLEAR_TOP which would send the new Intent to the existing Activity. You'll have to think and perhaps experiment with what happens as the user moves around your stack though and whether that will make your app re-appear in the recent apps.

Nitesh
  • 3,868
  • 1
  • 20
  • 26