I have added a button called buttonA to this .java file which plays the sound file 'clubb1'. How do I add other buttons such as buttonB and buttonC etc. and link these to new sound files such as 'clubb2' and 'clubb3' within this code? I am new to coding and therefore do not know how to add more?
public class FragmentOne extends Fragment {
SoundPool Clubb1;
int clubb1Id;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Clubb1 = new SoundPool(10, AudioManager.STREAM_MUSIC, 1);
clubb1Id = Clubb1.load(getActivity(), R.raw.clubb1, 1);
View rootView = inflater.inflate(R.layout.fragment_one_layout, container, false);
Button buttonA = (Button) rootView.findViewById(R.id.buttonA);
buttonA.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Clubb1.play(clubb1Id, 1, 1, 1, 0, 1);
}
});
return rootView;
}
}