Created
October 29, 2018 04:39
-
-
Save prdpspkt/d47d248ed0f9f59a42c5c1cb51ec800a to your computer and use it in GitHub Desktop.
Dynamically adding items and setting icons in Navigation Drawer Menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final Menu menu = navigationView.getMenu(); | |
for (int i = 0; i < types.size(); i++) { | |
MenuItem item = menu.add(R.id.notice_types, types.get(i).type_id, 0, types.get(i).name); | |
item.setIcon(R.drawable.asterisk); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment