Android How to refresh a drawer menu?

1

Good morning.

I have a drawer menu which I assigned some data to, but to be able to see the result I have to close the application and reopen it again, so I've been looking for a way to update the drawer menu (side menu) to see the changes without closing the app. What should I do or use to resolve this situation? First of all, Thanks. I tried to refresh it in this way from the method that changes the data of the drawer menu

((LeftMenuActivity) activity).updateDrawer();
    
asked by devjav 18.11.2016 в 15:32
source

1 answer

0

The Navigation Drawer usually loads a list of data in an Adapter, what you have to do is simply update the data inside this Adapter, and call the method notifyDataSetChanged () to update data within DrawerLayout :

for example:

public void updateDrawer(){           
       adapter.notifyDataSetChanged();      
       mDrawerList.setAdapter(adapter);
}
    
answered by 18.11.2016 в 17:18