Hi all,
I'm developing an application that has a login screen that only is
shown when the user has not been registered before. If the user was
registered before the main screen is open. To implement this feature i
have added an initial activity (action=android.intent.action.MAIN,
Category=android.intent.category.LAUNCHER) that shows a splash image
and contains the logic to determine if it is necessary showing the
Login or the Main screen. These activities are launched with the
method startActivity.
The application works OK when it is launched from the Home screen but
i have problems when it is launched clicking the button “OPEN” once it
was installed.
This is the description of the problem:
-Download application from server
-Install application
-Select option “Open”
-The application is open. At this point the applications works OK. The
login screen is shown and the user can enter the login data to open
the main screen.
-Press 'Home' button. Application is minimized.
-Open the application again from and this is the problem: the initial
activity is created again!!! It doesnt't keep the previous state. So,
there are two differents tasks at the same time.
When the application is launched from Home this wrong behaivor doesn't
happen. And i think the problem is the missing flag
FLAG_ACTIVITY_RESET_TASK_IF_NEEDED when the application is open after
installing. This flag is added when the application is open from HOME
The launchMode of the initial screen is set with “singleTop”. I also
tried with singleInstance and singleTask but the behaivor is the same:
the previuos state is not kept.
This is the log when the initial activity is launched after
installing:
07-06 11:26:42.973: INFO/ActivityManager(56): Starting activity:
Intent { action=android.intent.action.MAIN flags=0x10000000 comp=
{com.myapplication/com.myapplication.InitScreen}
This is the log when the initial activity is launched from HOME:
07-06 11:27:42.483: INFO/ActivityManager(56): Starting activity:
Intent { action=android.intent.action.MAIN categories=
{android.intent.category.LAUNCHER} flags=0x10200000 comp=
{com.myapplication/com.myapplication.InitScreen} }
There is a difference between the flags: 0x10000000 vs 0x10200000
Does it make sense? How can i launch the application after installing
it and keep the status of the activities once it returns from HOME?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---