You are here
Home > Android > ListView inside Navigation Drawer in Android

ListView inside Navigation Drawer in Android

Hello Friends, Today I am going to share a code to place ListView inside Navigation Drawer in Android. A list view is an adapter view that does not know the details, such as type and contents, of the views it contains. Instead list view requests views on demand from a ListAdapter as needed, such as to display new views as the user scrolls up or down. To know more about list view click here. Placing ListView inside Navigation Drawer concept can be used to generate dynamic menu, i.e fetching menu items from database using web service, etc.

ListView item comes from Adapter which can be of two types:-
1. ArrayAdapter – to show single item
2. BaseAdapter  – to show custom list item just as in video below

So, Here is code

MainActivity.java

activity_main.xml

Item.java

NavigationDrawer.java

activity_navigation_drawer.xml

app_bar_navigation_drawer.xml

content_navigation_drawer.xml

list_view_item_type1.xml

list_view_item_type2.xml

Video

Download Android Studio Project

 

Thanks for stopping by
Please do share if you like it

Rajesh Kumar Sahanee
I am a passionate Java Developer and I like Computer Programming. I love to do some interesting experiments and listening music in my free time.
https://www.zatackcoder.com

Comments

zatackcoder
Top