Saved Instance State

Your character attribute app is really shaping up. You can press GENERATE and create character stats to your heart’s content. But there is still a problem. To see it, run the emulator, then simulate rotating the phone by clicking on one of the rotation icons in the emulator options window (Figure 21.16):

Figure 21.16  Rotating the emulator

Rotating the emulator

The UI shows different character data (Figure 21.17):

Figure 21.17  Different character data after rotating

Different character data after rotating

The data shown in the UI changed because of how Android’s ...

Get Kotlin Programming: The Big Nerd Ranch Guide, First Edition 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.