I have an application using navigation drawer that provides list of locations. In the drawer, there are several options (like choosing country, city, etc) that user can setu
reVerse answer is right in case you are using ActionBar as well. in case you just use the DrawerLayout directly, you can add a DrawerListener to it:
View drawerView = findViewById(R.id.drawer_layout);
if (drawerView != null && drawerView instanceof DrawerLayout) {
mDrawer = (DrawerLayout)drawerView;
mDrawer.setDrawerListener(new DrawerListener() {
@Override
public void onDrawerSlide(View view, float v) {
}
@Override
public void onDrawerOpened(View view) {
}
@Override
public void onDrawerClosed(View view) {
// your refresh code can be called from here
}
@Override
public void onDrawerStateChanged(int i) {
}
});
}
As per kit's comment, addDrawerListener() should be used now that setDrawerListener() has been deprecated.