I had to use GIF image in RecyclerView.In first position GIF is playing. then i moving to the next items.then previous GIF image will should be stop. How to solve this task.
use the getDrawable()
method to get the GifDrawable
object and call the stop()
method:
((GifDrawable)buttonGifImage.getDrawable()).stop()
or since you have setup as background resource:
buttonGifImage.setBackgroundResource(R.drawable.gifImage);
use: ((GifDrawable)buttonGifImage.getBackground()).stop()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.