Issue
I have a problem with my application when it is brought back to the foreground in the case the phone went low on memory while the application was hidden:
The class inheriting from Application
is re-created (onCreate
is called again), thus losing data it held before. The Activity
which is restarted is not the one tagged as main action in the Manifest, but the last one that was active. This is a problem as the main activity, from which the user logs in, is the one responsible for filling in the Application
subclass' data and I can't fill it in later.
Is there any way to tell the application to restart at the main activity instead of the latest one in this case ?
Solution
You could check in onResume() if the user is logged in. Means that you check if your Application data is filled. If this is not the case, finish the activity and start your first Application.
The user expect to return to the latest activity, so a general "always start first activity" would upset the user...
Answered By - WarrenFaith
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.