in my android application i'm using greeDAO ORM for sqlite. so i retrive my category list :
List<ArticleCategory> categories = articleCategoryDao.queryBuilder().list();
each ArcticleCategory
object has name and description property so i can use these for name and description of drawer items.my question is how to add this list to myDrawer
items and how to manage their click's event. and this is my drawer codes :
Drawer myDrawer = new DrawerBuilder().withActivity(this).withToolbar(toolbar)
.addDrawerItems(
new PrimaryDrawerItem().withName("Home").withIcon(GoogleMaterial.Icon.gmd_import_contacts).withIconColor(Color.BLACK)
)
.withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
@Override
public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
return false;
}
})
.withAccountHeader(navigationHeader)
.withDrawerGravity(GravityCompat.START)
.build();
please keep in my mind i have some static items that i manually and items to drawer and some dynamic that come from database so click event is very important for me in this scenario.