Is it recommended to use more than one Activity in an Android project?

0

I always use multiple (in large project with web service and everything), is it ideal to use only one or is there no problem using multiple?

    
asked by anonymous 23.06.2015 / 15:35

4 answers

1

Using more than Activity is an option and not an obligation; with the advent of Fragments , you can have an application with a single Activity and several Fragments , which would actually be the screens of your application.

As I once heard, Activity would be the stage and% of the actors.

An application that behaves like a SPA (Single Page Application).

Advantages:

  • Support for tablet-specific layouts;
  • Fragments do not depend on the obsolete method onRetainNonConfigurationInstance () (or from worse thing ) so they will not be destroyed during a screen rotation or any other configuration change;
  • Action Bar is not re-created at every screen change.
03.09.2015 / 15:14
0

Yes, each Activity typically represents a screen for the Android project.

    
23.06.2015 / 16:17
0

You can use as many of the activities as you need for your needs, which is why very large multi-screen projects require more organization and control of the processes.

    
27.06.2015 / 03:42
0

Better to use an activity for each screen. If you use methods to inflate another layout, you will be carrying the luggage of the previous layout, such as open database, visible keyboard, etc. Good practice is an Activity for each Layout.

    
24.06.2015 / 02:23