5

I want to disable the recent apps intent that is fired from the icon when you hold the home button. I am currently detecting, in the onCreate(), if the intent is fired from the quick launch dialog, and then I call finish().

This entails that when the application goes to the background finish() is called so that when the app is launched it goes through the onCreate(). This requires strategic coding when switching between activities in the application.

I guess I can fire finish() in the onResume() also after detecting where the intent came from, but a bunch of unnecessary coding can be eliminated if the quick launch intent can simply be disabled.

Can the quick launch intent be disabled?

M. Tibbits
  • 8,400
  • 8
  • 44
  • 59
Noah Seidman
  • 4,359
  • 5
  • 26
  • 28
  • What is Quick launch intent? Is it the intent that is sent when clicking the app icon in home screen? – Vinay Jun 20 '10 at 14:29
  • Its the intent fired from the icon in the dialog opened when you hold the home button. – Noah Seidman Jun 20 '10 at 14:30
  • Can you post the Intent Action that is received? – Vinay Jun 20 '10 at 14:39
  • 1
    I am using the LAUNCHED_FROM_HISTORY flag to detect its launch from the recent apps dialog. Intent intent = getIntent(); if((intent.getFlags()& Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY)!=0){ // Launch from recent app dialog!!! } A more elegant solution would be convenient. – Noah Seidman Jun 20 '10 at 14:54

1 Answers1

18

Can the quick launch intent be disabled?

Put android:excludeFromRecents="true" in the manifest for this activity. That will cause your activity not to appear in the list of recently used activities, which is what I am assuming you are calling the "quick launch".

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491