This can only be accomplished in API 11+ if your background is a solid color.
int color = Color.TRANSPARENT;
Drawable background = view.getBackground();
if (background instanceof ColorDrawable)
color = ((ColorDrawable) background).getColor();
More Related Contents:
- Android-change cardview background color parsing json
- Animate change of view background color on Android
- How to change DatePicker dialog color for Android 5.0
- Get the background color of a button in android
- How to change color of ListView items on focus and on click
- How to set text color of a TextView programmatically? [duplicate]
- Set Background color programmatically [duplicate]
- Change the background color of a pop-up dialog
- Error in launching AVD with AMD processor
- How to create a custom-shaped bitmap marker with Android map API v2 [duplicate]
- Android: Using findViewById() with a string / in a loop
- Android ICS and MJPEG using AsyncTask
- Android Error – Open Failed ENOENT
- Manually put files to Android emulator SD card
- Understanding keystore, certificates and alias
- How to use RadioGroup in ListView custom adapter?
- Why does it take so long for Android’s MediaPlayer to prepare some live streams for playback?
- Refreshing activity on receiving gcm push notification
- Hiding Title in a Fullscreen mode?
- How to run CountDownTimer in a Service in Android?
- android httpclient hangs on second request to the server (connection timed out)
- How to get any identifier of the topmost activity?
- when using AlertDialog.Builder with EditText, the Soft Keyboard doesn’t pop
- Tracking progress of multipart file upload using OKHTTP
- How to Overlap items in LinearLayoutManager – RecyclerView (like stacking cards)
- Implications of Android multiple user support (new in 4.2) for server side data model (e.g. android_id)
- Starting app only if its not currently running
- How to draw waveform of Android’s music player? [closed]
- How to overcome this item padding in navigation drawer?
- Android change layout dynamically