Changes

Implementing an Android Navigation Drawer

15 bytes removed, 07:45, 28 January 2016
m
Text replacement - "<google>BUY_ANDROID_STUDIO6</google>" to "<htmlet>androidstudio_a6</htmlet>"
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
</android.support.v4.widget.DrawerLayout>
</pre>
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
== Opening and Closing the Drawer ==
If it is appropriate to do so, and as outlined in the above example, it is also important to close the drawer after the item has been selected.
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
== Using the Navigation Drawer Activity Template ==
The code then obtains a reference to the NavigationView instance before declaring the current activity as the listener for any item selections made within the navigation drawer.
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
Since the current activity is now declared as the drawer listener, the onNavigationItemSelected() method is also implemented in the NavDrawerActivity.java file. The implementation of this method in the activity matches that outlined earlier in this chapter.
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>