Issue
I have a small application that sequentially starts multiple alarms (AlarmManager
) with different parameters. For example, as soon as alarm one is finalized, alarm two is started. Then the flow would be something like this:
Considering the Android life-cycle, what is the best way of implementing this application?
- Having a single activity that handles the different alarms and states with variables or
- calling different activities for each different alarm?
The views are simple and very similar (reusable).
EDIT: In the single activity scenario, what would happen if the application is then killed? The AlarmManager
would still call the application, but I would loose the state and I'd be back to first step, wouldn't it?
Solution
One of the defining features of activities is that they are easy to navigate to and away from. I'd say that you should be better off using a single complex activity, because otherwise you would have to tackle the activity back-stack. It doesn't seem that you want to be able to navigate back from alarm 2 to alarm 1, which means that using separate activities is pretty pointless.
Answered By - npace
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.