1
I wanted every item of the ListView
played a song by clicking the button referring to each item, but when I click the button, it even plays, only q only the first song, the other songs in the list do not play.
I used a listview
personalized in the main activity and my adapter
is like this:
public class Adapter extends ArrayAdapter<Itens>{
private MediaPlayer mMedia;
(...)
final Button playButton = (Button)layout.findViewById(R.id.start);
if (item.hasAudio()){
playButton.setOnClickListener(new View.OnClickListener(){
@Override
públic void onClick (View v){
mMedia = MediaPlayer.create(getContext(),item.getAudio());
mMedia.start();
mMedia.onCompletionListener = (...)}
return Layout;}
has made some code, which language is using?
– novic
What do you already have? Your question involves many steps and a complete answer would be unfeasible. Focus on a specific problem.
– Pablo Almeida
I got the question. Do you know how to fix? The language is android.
– Isabela Andrade