views:

59

answers:

3

I have Two activities One splash screen, Player screen.

When user clicks on my app icon first splash screen is displayed and then player screen

When player activity is running, if user returns to the home screen and then again clicks on app icon, the application is starting from the splash screen again.

can any one please help me out how to do any one of below

1) I need to close current running activity and reload application. or 2) I need to resume to the player screen directly.

Please give me an example or reference to follow, Im beginner in android programing

Thanks In advance

A: 

This is what you have to do: I need to resume to the player screen directly.... and you can do so by following this instructions: How do I save an Android application’s state?

Cristian
A: 

You may want to overrive the onRestart() method - it will be invoked if your Activity has been stopped previously; while it won't if it's the first time it runs (or if it has effectively been killed in the meantime).

Be sure to read the Activity life cycle there: http://developer.android.com/guide/topics/fundamentals.html#lcycles to understand what happens when.

Joubarc
A: 

Check out the order in which the life cycle states appear. You could override onStart, onPause, onResume, onStop, onCreate, onDestroy etc functions by adding Toasts to see the sequence. Then you can override them as per your programming requirements.

kiki