6.7 MainActivityFragment
Subclass of Fragment
Class MainActivityFragment
(Fig. 6.6) overrides four Fragment
methods:
onCreateView
(lines 17–28)—As you learned in Section 4.3.3, this method is called after aFragment
’sonCreate
method to build and return aView
containing theFragment
’s GUI. Lines 22–23 inflate the GUI. Line 26 gets a reference to the
Get Android How to Program, 3/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.