> What would be wrong with this:
> @Override
> public void onClick(View view) {
> MediaPlayer mp = MediaPlayer.create(this, R.raw.a2);
> mp.start();
>}

In this case I can to click only 27 times.
Then I hve exception - NullPointerException

In m5 worked variant:

if( mSoundFx != null )
      mSoundFx.pause();
mSoundFx = mSoundFxs[aBonusType];
mSoundFx.seekTo(0);
mSoundFx.start();

where mSoundFx - MediaPlayer mSoundFx;
and mSoundFxs  - MediaPlayer  mSoundFxs = new MediaPlayer[]{
MediaPlayer.create( mContext,R.raw.no2),
MediaPlayer.create( mContext,R.raw.trc_ok2),
MediaPlayer.create( mContext,R.raw.type2) ,
MediaPlayer.create( mContext,R.raw.side2),
MediaPlayer.create( mContext,R.raw.appl2),
};

But in 9beta and 1.0_r1 it does not work.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to