I would like to know how to set a ViewPager background programmatically? In xml I can manually set the background like this: android:background="@drawable/ic_launcher". I am getting a uri from a SQLite database and converting it to a Bitmap. I want to set that Bitmap as the background. Is this possible?
try first convert bitmap to drawable like
Drawable d = new BitmapDrawable(getResources(),bitmapobject);
than use
setBackgroundDrawable(d);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With