tags:

views:

64

answers:

1

Hi, I'm trying to create a setup activity for my Android application which my users would see the first time they opened the app, but never again unless they wanted to redo the setup. How do I create this setup activity as the first activity without giving it MAIN/LAUNCHER intent-filters? (I want to use those for my home activity.)

+4  A: 

If the onCreate method of an Activity launches another activity, it appears as though the first activity doesn't show.

So, make your real first activity the main/launcher activity.

In the onCreate method of that first activity have a check for whatever setup config should be present.

If the setup is not configured, start up the Setup activity.

Otherwise, the first activity will show.

Mayra
Thank you very much! I put an intent for the setup in the beginning of main activity's onCreate(), put a (public, static) setup boolean to be false in the main activity class, and then at the last step in my setup set the boolean flag to true. Works like a charm, now every other time I open it my program goes straight to the main activity.
jmiles