I have 4 modules in an application that are not related to each other. So I previously had created 4 different activities all extending to a base activity that implements the NavigationDrawer. I would like to know if it is better to use fragments over here instead of activity?. I mean, if I make one activity that implements the NavigationDrawer and create 4 fragments for the 4 modules?. Also, what is the difference between Fragment and FragementActivity?
Asked
Active
Viewed 450 times
0

Abhinav Nair
- 958
- 1
- 8
- 29
-
Also, my application will only support portrait mode. – Abhinav Nair Mar 25 '16 at 10:03
-
FragmentActivity is, well, not a Fragment... And it's deprecated in favor of AppCompatActivity – OneCricketeer Mar 25 '16 at 10:50
1 Answers
0
I think one activity that implements the NavigationDrawer and creates 4 fragments for the 4 modules. It's better!
Activities
are designed to represent a single screen of the application, while Fragments
are designed to be reusable UI layouts with logic embedded inside of them. According to Google's lectures :Multi-Versioning Android User Interfaces . Fragments
makes your code easier to maintain and control.
what is the difference between Fragment and FragementActivity?
You can see here: Difference between Fragment And FragmentActivity

Community
- 1
- 1

Hoang Nguyen
- 141
- 1
- 8