Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert moving image as a background on screen in android

my question might seem simple. I want to insert this kind of image as a background on the activity.(Normal images can be inserted by android:background or setBackground which are in drawable resources). But is this kind of images insertions possible at all? Or any other alternative way to achieve this? Please suggest.

like image 535
hrithik Avatar asked Feb 23 '26 23:02

hrithik


1 Answers

Android doesn't really support animated gifs in an easy manner, so that goes out the window. You can have a layout with a background drawable, that you can use an AsyncTask or Handler to loop through the images. The background layout would contain all your UI elements (or other layouts with your UI elements) and the layout_width and layout_height be set to "match_parent".

like image 182
ajacian81 Avatar answered Feb 25 '26 14:02

ajacian81



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!