android - Navigation drawer Menu list item not updating programmaticaly -


i have been working on android project.i have setting activity, if tick option a, navigation drawer should show option a , when don't tick, shouldn't. state of tick button saved in shared preferences.

how make navigation drawer check value in shared preferences decide whether show or not show item a?

i'm doing 2 different xml files. in xml files set id groups in activities onresume remove each groups code:

navigationview.getmenu().removegroup(r.id.first_group); 

then check shared preferences tick state , if statement this:

if (tick) {         navigationview.inflatemenu(r.menu.drawer_tick); } else {     navigationview.inflatemenu(r.menu.drawer_nottick); } 

Comments

Popular posts from this blog

c - zlib and gdi32 with OpenSSL? -

java - inputmismatch exception -

ios - Align baselines with characters in large line heights with Text Kit -