In Android Studio set git as version control for this project.
Chapter 14 In HelloMoonFragment add onCreate and retain fragment.

When user rotates device, activity is destroyed
but now fragment instance with audio player will be passed to new activity and audio playback isn't interrupted.