In my Android wear application I have a WearableActionDrawerView
contained withen a WearableDrawerLayout
.
The problem that I am having is that I cannot figure out how to close the ActionDrawer programmatically.
Normally I would use the closeDrawer()
method, however I am using the new version in the support library which is in the android.support.wear
namespace (instead of the old wearable
namespace) and there is no such method.
I have tried looking in the docs for both the ActionDrawer Located here https://developer.android.com/reference/android/support/wear/widget/drawer/WearableActionDrawerView
As well as in the docs for the parent WearableDrawerLayout
located here https://developer.android.com/reference/android/support/wear/widget/drawer/WearableDrawerLayout
And not only couldn't I find a closeDrawer()
method, but I could not find any reference or method in the documentation as to how to close the drawer programmatically.
I figured it out, I had to first use the getController()
method to get access to the drawer controller and then on the WearDrawerController object call the closeDrawer()
method.
That's it.