March 2013
Beginner to intermediate
580 pages
16h 11m
English
Figure out how to persist your boxes across orientation changes from within your View. This can be done with the following View methods:
protected Parcelable onSaveInstanceState()
protected void onRestoreInstanceState(Parcelable state)
These methods do not work like Activity and Fragment’s onSaveInstanceState(Bundle). First, they will only be called if your View has an id. Second, instead of taking in a Bundle, they return and process an object that implements the Parcelable interface. We recommend using a Bundle as the Parcelable instead of implementing a Parcelable class yourself. (Implementing the Parcelable interface is complicated. It is better to avoid doing so when possible.)
For a harder challenge, make it so that ...
Read now
Unlock full access