![]() Switch fragment on menu item click event Open content_main.xml and replace the default TextView widget with a FrameLayout. However, to keep it simple, let’s keep what Android Studio give us. There are more info to fill in in this step because Android Studio auto-generate RecyclerView with its adapter. Similar to step above, add a list fragment named ItemFragment.java by clicking on package name > New > Fragment > Fragment (List). You don’t need to change any default settings generated by Android Studio. Let’s add a blank fragment named BlankFragment.java by clicking on package name > New > Fragment > Fragment (Blank). Out default Activity is MainActivity.java. Fill in project info as in following image: Start a new Android project with Navigation Drawer Activity. ![]() Switch fragment on menu item click event. ![]() Add FrameLayout to MainActivity’s layout. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |