I have a navigation drawer whose list can change based on an action in the current activity. After making a change in the current activity I update the list immediately in the code. I opened the navigation drawer, but no change has been shown. However if I proceed to change activities and open the drawer again, the change in the list is now updated. This leads me to believe that after the first time the Navigation Drawer is created or called, the drawer is reusing the same view instead of being destroyed and recreated.

I am looking for a method with Android that would be equivalent to onOpenDrawer, however I do not see one in the docs. In the docs there is onDrawerOpened(View view) which is called after the drawer has already been opened. I also have the option to call openDrawer(View view) which then annimates the drawer open.

I am wondering if there is a method that I am missing and that I can override which will allow me to update the listview being displayed in the navigation drawer.

Thank you in advance.

有帮助吗?

解决方案

Calling of notifyDatasetChanged() still applies to ListView adapter, regardless of ListView parent.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top