Hi guys I want to play a certain mp3 file when a text is clicked. For example, I clicked the word \"Nicholas\", the app have to play nicholas.mp3...
Sorry for my mes
You need to pass in a context instance into MediaPlayer.create method:
MediaPlayer mPlayer = MediaPlayer.create(PlayWorld.this, R.raw.aaanicholas);
Also, after the create() call, prepare is already executed, so you don't need to execute it explicitly, just invoke start() right after create().
create()
start()