Try the following:
Drawable clone = drawable.getConstantState().newDrawable();
More Related Contents:
- Android How to adjust layout in Full Screen Mode when softkeyboard is visible
- Understanding the Use of ColorMatrix and ColorMatrixColorFilter to Modify a Drawable’s Hue
- setBackground vs setBackgroundDrawable (Android)
- Pop up window over Android native incoming call screen like true caller Android app
- EditText: Disable Paste/Replace menu pop-up on Text Selection Handler click event
- Android – drawable with rounded corners at the top only
- Android Custom Shape Button
- Custom Fonts in Android
- How to make an Android SlidingDrawer slide out from the left?
- Incorrect Coordinates From getLocationOnScreen/getLocationInWindow
- How to save the image to SD card on button Click android [closed]
- Launching activity from widget
- Align top of image to top of TextView
- Why can’t one add/remove items from an ArrayAdapter?
- How to stop scrolling in a Gallery Widget?
- Dynamically creating Buttons and setting onClickListener
- How can I make my layout scroll both horizontally and vertically?
- Save image to sdcard from drawable resource on Android
- Finding the dominant color of an image in an Android @drawable
- How to use default Android drawables
- How do I set the rounded corner radius of a color drawable using xml?
- Items inside GridView getting repeated when screen scrolls
- How to add views dynamically to a RelativeLayout already declared in the xml layout?
- Change word color in resource string
- Creating an android smart app banner
- Only use XHDPI drawables in Android app?
- Resize Drawable in Android
- Placing ViewPager as a row in ListView
- Android WebView Scrollable
- Newer versions of Android Studio add only two drawable directories – drawable and drawable-v21