我有多个项目,单击时我想要一个声音。我收到一个错误 ( E / MediaPlayerNative:错误(1,-19)并且 E / MediaPlayer:错误(1,-19))。 我的代码
// set click listener to play the audio
mylist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
// get the allwords object at the given the position the user clicked on
Word word = allwords.get(position);
// create and setup media player with current word
mymediaplyer = MediaPlayer.create(PhrasesActivity.this, word.getaudio());
//start the audio
mymediaplyer.start();
}
});