0

I am very new developer for Android application so please ignore if there is some technical mistakes in my question.

I have five screen (Home, SR-1, SR-2,SR-3,SR-4 ) in my Android application and I can switch any screen at give time.

When we are pressing device back button it will take we to the previous screen where I was lastly.

But whenever I am pressing Home it will take me to landing screen If in this state I am pressing device back button I will take me to previous view but I want to remove this state maintenance.

(i.e. : When I am coming to Home and I pressed back button It will exit from my application)

Thank you

Nitesh Meshram
  • 545
  • 1
  • 8
  • 19

2 Answers2

1

From android pressing back button should exit the app :

Immediately after you start a new activity, using startActivity, make sure you call finish() so that the current activity is not stacked behind the new one.

Community
  • 1
  • 1
Vicente Plata
  • 3,370
  • 1
  • 19
  • 26
1

for each activity: you can add in AndroidManifest.xml

<activity android:name="nameofActivity"
android:noHistory="true"></activity> 
Hanry
  • 5,481
  • 2
  • 40
  • 53
  • Thank you!! This will not maintain history but I want to remove history when I press Home and after home app will have to start maintaining history again. – Nitesh Meshram Oct 01 '11 at 08:26