When developing an Android app, is there a rule of thumb for when you should stop changing layouts and instead switch to a new activity? What factors might influence the decision?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are no hard and fast rules, but I’ve got a few personal ones:
I primarily think of how my users will use the back button. In an optimal app, the natural use of “back” to go through Activities is what I aim for. Each time a user might want to use back, that should be a new Activity. Of course, rules are meant to broken and sometimes you’ll need to override the back button yourself to control a more complex interface.
Also, you shouldn’t be tempted to call
setContentView()again. If you are tempted to redo the entire layout of the page, maybe you should move to a new Activity instead.I would also check out this guide.