android - Update NavigationView state when user goes back to previous fragment -


i'm using navigationview drawer in app. i'm trying go previous fragment if user press button. code works well:

@override public void onbackpressed() {     fragmentmanager fm = getsupportfragmentmanager();             fragment fr = fm.findfragmentbyid(r.id.flcontent);      if (fm.getbackstackentrycount() > 0 ) {         fm.popbackstackimmediate();     }     else {         finish();     }         } 

but navigationview doesn't change. how can update navigationview state (check correct fragment, change title, , on), can reflect changes in app?

you should implement navigation using addtobackstack method. take @ this.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -