Backround Image Drawable does not work for Java
See original GitHub issueaddSlide(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:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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!