• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Playing sound when clicking on picture inside GridView

asgar.ali

Lurker
Hi,

I am using a grid layout to display some gifs which have different sounds. I use this code to display the images. I can see all different images in a grid on the screen. Now what I want to do is to play sound on click of every picture. How can I do that? Can someone help me on that pls

Thanks

public​
void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.
main);
GridView gridview = (GridView) findViewById(R.id.
gridview);
gridview.setAdapter(
new ImageAdapter(this));

}
 
Back
Top Bottom