views:

62

answers:

1

Here's my two scenarios.

1 - User opens app for the first time ever from android home screen User is presented with "first time" screen (backed by first time activity, lets call it A) User hits back button user is returned to android home screen

2 - User opens app for second time User is presented with the main list screen of the application (backed by a list activity, let's call it B) User hits back button User is returned to android home screen

I'm already aware of numerous ways to detect whether it's the first time opening the app or not.

The problem is in having the back button return to the home screen rather than a routing activity that decides which screen to forward to.

Currently My app has an activity to decide where to route (lets call it R) the problem is, My stack either looks like R -> A or R -> B

I want A or B to replace R on the stack when they open, and if the user hits back, then they go to the android home screen, not back to R.

Having a collaborator that sets the view for A and B is also not really workable as B extends androids concrete implementation of a list Activity to get most of its functionality.

Any ideas?

+1  A: 

I want A or B to replace R on the stack when they open, and if the user hits back, then they go to the android home screen, not back to R.

Call finish() in R after it calls startActivity() to trigger the opening of A or B.

CommonsWare