Reputation: 571
I want to use a audiolist in my custom listview and I want to if I click specific icon in listview then audio should work.
@Override
public void onClick(View v) {
if (position==0){
player = MediaPlayer.create(getContext(), R.raw.loveee);
player.start();
}else if (position==1){
if (player.isPlaying()){
player.pause();
player = MediaPlayer.create(getContext(), R.raw.hello);
player.start();
}
}
}
});
Upvotes: 1
Views: 38