January 2014
Intermediate to advanced
736 pages
70h 43m
English
The onCreateView method (Fig. 8.45) obtains the selected contact’s row ID (lines 70–79). If the Fragment is being restored, we load the rowID from the savedInstanceState bundle; otherwise, we get it from the Fragment’s Bundle of arguments. Lines 82–93 inflate the GUI and get references to the TextViews.
61 // called when DetailsFragmentListener's view needs to be created62 @Override63 public View onCreateView(LayoutInflater inflater, ViewGroup container,64 Bundle savedInstanceState)65 {66 super.onCreateView(inflater, container, savedInstanceState);67 setRetainInstance(true ); // save fragment across config changes68 69 ...
Read now
Unlock full access