0

I am newbie. I can't find an answer. I have a ViewPager with a stack of swipeable images.

I need to make it so that when a certain picture is opened, the sound that is assigned to it is played. Tell me in which direction to look, so far I can only make the sound play when the first picture is opened, just by launching the MediaPlayer, but this is not at all what I need.

TofferJ
  • 4,678
  • 1
  • 37
  • 49
AlexP
  • 1

1 Answers1

0

check out onPageChangeListener (first answer with example) or even SimpleOnPageChangeListener - play desired music in onPageSelected(int position) method

snachmsm
  • 17,866
  • 3
  • 32
  • 74