I am using this example for navigation drawer. When clicking on of item of left drawer listview it shows some images but drawerLayout closes not smoothly.
What should I do here for smoothly close left drawer layout after clicking of the item of listview.
Just posting the drawerLayout.closeDrawer() on the message queue using the handler, with a minimal delay solved my problem. Handler.postDelayed() is the key here.
Works perfect
I don't use threads, because i need to update UI after close the navigation menu.
Following code works for me.
i am using fragment as member variable of class to update ui
setFragment() function use to assign fragment to fragment variable
In onDrawerClosed() event, i update ui.
Not sure this is the best route, but the way I solved this was to create a pending Runnable that runs in
onDrawerClosed
. Eg: