Created
September 24, 2015 00:03
-
-
Save mortenjust/0c6b896a606cafa8f0e5 to your computer and use it in GitHub Desktop.
Finding out if an object can be casted to a certain class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(((ImageView) view).getDrawable() instanceof StateListDrawable){ | |
| Log.d(TAG, "It totally is a statelister"); | |
| } else { | |
| Log.d(TAG, "It's not a statelist"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment