Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I create an activity for each screen?

I will start with an example... If you go to Settings > Applications > Manage applications, a new screen will open with a list of the installed applications: if you click on any application of the list, it will open a new screen containing information about the application.

Well, some settings of my application must be managed through a list, and this list should behave like the above example. I have already created a PreferenceActivity with some categories, each of which has some items: when I click on one of these items, I would like it to open a new screen where the new data is placed on a list, just like the list of the applications of the above example. Moreover, when I click on any entry of this list, it will open a new screen in order to set some data.

How should I proceed? Should I create an activity for each screen?

like image 499
enzom83 Avatar asked Dec 17 '22 01:12

enzom83


1 Answers

Android was created this way, according to the documentation "An activity is a single, focused thing that the user can do.", so yes, you should have an activity for each screen. This changed a little with Honeycomb with the introduction of Fragments, but if you're not developing for tablets you should keep the one page, one activity mindset on Android.

like image 79
Marcio Covre Avatar answered Jan 05 '23 10:01

Marcio Covre