Assuming you are implementing the Navigation Drawer
by a ListView
, you will need to modify the layout for the list item by adding an ImageView. Then you should modify the adapter you use to populate the ListView
so that it sets the src
of the ImageView
accordingly.
Quoting the guide you linked:
// Set the adapter for the list view
mDrawerList.setAdapter(new ArrayAdapter<String>(this,
R.layout.drawer_list_item, mPlanetTitles));
That's where most of your changes will be wired: specifying a layout containing a TextView and and ImageView and creating a new Adapter.
As a convenience, you might create a class called something like NavDrawerItem which will have two fields: one for the icon, the other the caption which you'll display through a TextView
.
In your adapter, be sure to consider the menu items for which you won't be displaying an icon.