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
  • 336
  • 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,868
  • 19
  • 93
  • 104
1

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

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
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
  • 602
  • 5
  • 12
0

Closing a Activity on new Activity

Community
  • 1
  • 1