0

I am developing an application and in that case I've some activities which I don't want to show them again e.g like i have a splash screen which is my activity and i don't want it to show again on back key press.

Thanks in Advance

Hasandroid
  • 316
  • 5
  • 12

4 Answers4

3

Set android:noHistory="true" to the activity entry at the AndroidManifest.xml. That will prevent the activity from being saved on the stack.

Kartik Domadiya
  • 29,430
  • 19
  • 92
  • 103
1

Call finish() on the activity after you call startActivity() to start the next one.

CommonsWare
  • 954,112
  • 185
  • 2,315
  • 2,367
1

There is a manifest parameter that lets you permanently disable activity stack history for particular activities.

See: Removing an activity from the history stack

Community
  • 1
  • 1
RawwrBag
  • 592
  • 4
  • 12
0

Closing a Activity on new Activity

Community
  • 1
  • 1