Android studio NavigationDrawer sub items that change on runtime
<p>I really need your help on editing my navigation drawer. I want to add sub items to it as shown here: 
<a href="https://i.stack.imgur.com/58Sas.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/58Sas.png" alt="example"></a></p>

<p>or here: 
<a href="https://i.stack.imgur.com/SNBAA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SNBAA.png" alt="example2"></a></p>

<p>I have tried to search for similar questions on google but didn't find an answer. To me, its seems that possible solution may be to add a group of items after 3rd item and make this group invisible, but when the user clicks on "parent" it will become visible. However I am not sure how to insert group of items after specific index in menu and that may not be the best solution. 
So I am asking for experienced developers to help me find the best solution.</p>