question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Backround Image Drawable does not work for Java

See original GitHub issue
addSlide(AppIntroFragment.newInstance(
   "Title", "Description", R.drawable.image_drawable_1,
   R.drawable.background_image, Color.WHITE, Color.WHITE, 
   R.font.raleway_medium, R.font.raleway_medium
));

Background image drawable above (R.drawable.background_image) does not get recognized as a drawable but a simple integer which can only be used as a color.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
victor-mcastcommented, Jun 26, 2020

Well, I just figured out why the background drawable was not being applied. I was experimenting with the color backgrounds before I decided to change to background drawables. For the color backgrounds I had setColorTransitionsEnabled(true). This was the culprit. Using this method will forcibly remove the background drawables. I suggest you update your documentation about this. Thanks.

0reactions
teekamsutharcommented, May 8, 2022

Well, I just figured out why the background drawable was not being applied. I was experimenting with the color backgrounds before I decided to change to background drawables. For the color backgrounds I had setColorTransitionsEnabled(true). This was the culprit. Using this method will forcibly remove the background drawables. I suggest you update your documentation about this. Thanks.

Thanks, you saved my day!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How set background drawable programmatically in Android
layout.setBackgroundResource(R.drawable.ready); is correct. Another way to achieve it is to use the following: final int sdk = android.os.
Read more >
How to set background drawable programmatically in android?
This example demonstrates how do I set background drawable programmatically in android. Step 1 − Create a new project in Android Studio, ...
Read more >
Drawables overview | Android Developers
A Drawable is a general abstraction for something that can be drawn. The various subclasses help with specific image scenarios, and you can...
Read more >
How to Set Background Drawable Programmatically in Android?
Navigate to app>res>drawable>Right click on it>New Drawable file and name it as back_drawable and add the below code to it. Comments are added ......
Read more >
Android Studio : How to Add a Background Image to Activity
Adding a background image in Android Studio. ... doesn't begin shortly, try restarting your device. Your browser can't play this video.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found