1. On Select of each Main Menu Item (M1 to M9) I have to update the Sub
Menu
You'll need :
NavigationDrawer
for SubMenu.
TabLayout
for M1 to Mn.
Fragment
s for displaying contents in Display Area.
You also have few options to replace/change the SubMenu:
- Whenever
Fragment
changes, get the key or id of the current Fragment, then change the SubMenu as you need.
- Get the current Fragment instance and update/change the SubMenu.
And the other method...
2. First Item will be selected by default in Sub Menu
Of course, you can set any item you want to be selected as default. Or:
navigationView.getMenu().getItem(0).setChecked(true);
- Selected Sub Menu Item" detail will be displayed in "Display Area
It sure it will. You'll just need to replace your Fragment
.
Changing the SubMenu in my suggested case will not be a difficult thing to do:
https://stackoverflow.com/a/33072760/4409113
Replacing Fragment
:
Replace one fragment with an another fragment
You can start with this example of NavigationDrawer
, TabLayout
and Fragments
:
https://github.com/LinX64/AndroidSupportDesign-TabLayout