3. List
● To show items in vertical
scrolling list
● Use ListView component
● Item format can be
customized, and most of
apps are doing this way.
4. ListView
● Add ListView component
● Default list only contains string
● Item format can be customized,
and most of apps are doing this
way.
5. ArrayAdapter
● Set list items threw ArrayAdapter.
● android.R.layout.simple_list_item_1 -> Default list format provided by Android
6. ListView
● setOnItemClickListener -> Set onItemClickListener for list items
● ...ClickListener -> Usually used to get response after click certain item
7. Fragment
● Piece of an application's user interface that can be placed in an Activity.
● Single Acvitity contains single/multiple fragment, and each of it can be used
like Activity
● Used for dynamic & multi-pane UI
8. Start Fragment
● onCreateView -> Creating view layout of fragment
● inflate.inflate? -> Create View instance with defined resource
o In this case, set View with R.layout.fragment_main resource file
9. Start Fragment
● FragmentManager -> Interface for interacting with Fragment
● FragmentTransaction -> Add a fragment to the activity state
o In code above, use FragmentTransaction.replace to input layout to target
fragment
11. DrawerLayout
● Container for window content that allows for interactive "drawer" views to be
pulled out from the edge of the window.
12. DrawerLayout
● FrameLayout: Layout for
setting main view
● ListView: List which will be
setting on drawer
● DrawerLayout is included on
Android v4 Support Library
package
● For more, look on
http://developer.android.com
/tools/support-
library/features.html#v4
13. DrawerLayout - onCreate
● Set default fragment on onCreate
● DrawerLayout.setDrawerListener: Set event action on drawer
● Change fragment when list item on list view has been clicked, and close with
DrawerLayout.closeDrawer