Play button wont work


The app loads up fine, but will not play the audio file
maybe its the emulator as i’m not seeing any errors in logcat…

Should the Android manifest file call HelloMoonActivity or HelloMoonfragment?


            <category android:name="android.intent.category.LAUNCHER" />


The launcher should call HelloMoonActivity, your manifest file appears correct.

I suggest you do some debugging, perhaps starting with your play button, and its onClick(…) method.


In Listing 13.3 the hellomoon_playButton and hellomoon_stopButton cannot be resolved. Although my version of the fragment_hello_moon.xml file seemed correct, I overwrote it with the same file from the Book Solutions. This didn’t help. The generated R file doesn’t have these buttons defined. Any suggestions?


I have the same problem, the reason is my version of ADT.
since my version of ADT is 22.6.1, and there is a automatic generated code like below in

if (savedInstanceState == null) {
					.add(, new PlaceholderFragment()).commit();

when I delete the piece of code, the problem resolved.