Play button wont work


#1

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?

[code]


            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>[/code]

#2

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.


#3

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?


#4

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 HelloMoonActivity.java.

if (savedInstanceState == null) {
			getSupportFragmentManager().beginTransaction()
					.add(R.id.helloMoonFragment, new PlaceholderFragment()).commit();

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