I am implementing an Activity having BottomNavigationBar with 4 clickable items. Let's call those items as Profile, Timeline, Messages, Find Friends. The user is taken to Activity with these 4 Option in Bottom Bar after authentication.My doubt is whether to open a fragment in the space left for these options or to open a new activity whenever user clicks on any of these options. Since, these 4 options will have completely different functionality what would be the ideal way to implement this, Activity/Fragment.
Asked
Active
Viewed 31 times
0
-
1If your are planning to have your navigation bar on each new screen, I would go with fragments. Then you don't have to create a new instance of the navigation bar 4+ times. – hopeman Oct 13 '18 at 11:39
-
@hopeman yes this navigation bar will always be visible after the user authentication irrespective of the option selected. So, fragment will be my go to option right? – Abhishek Oct 13 '18 at 11:41
-
Yes, fragments give you more flexibility here, and save you resources. – hopeman Oct 13 '18 at 11:44
-
1I think Fragments is perfect options for navigation bottom bar. You can refer to this link also:https://www.truiton.com/2017/01/android-bottom-navigation-bar-example/ – Devangi Oct 13 '18 at 11:45
-
@hopeman thanks for the answer!! – Abhishek Oct 13 '18 at 11:45
-
@Abhishek no worries. – hopeman Oct 13 '18 at 11:47