Rotating GeoQuiz

GeoQuiz works great … until you rotate the device. While the app is running, press the NEXT button to show another question. Then rotate the device. If you are running on the emulator, click the rotate left or rotate right button in the floating toolbar to rotate (Figure 3.2).

Figure 3.2  Control the roll

Control the roll

If the emulator does not rotate after you press one of the rotate buttons, turn auto-rotate on. Swipe down from the top of the screen to open Quick Settings. Press the auto-rotate icon, which is the third icon from the left (Figure 3.3). The icon will change from grayed out to a teal color to indicate that auto-rotate is now on.

Figure 3.3  Quick Setting for auto-rotate

Quick Setting for auto-rotate

After you rotate, you will see the first question again. How and why did this happen? The answers to these questions have to do with the activity lifecycle.

You will learn how to fix this problem in Chapter 4. But first, it is important to understand the root of the problem so you can avoid related bugs that might creep up.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.131.13.37