Is there a way I can find what resource a particular ImageButton is set to, at any given time?
For eg: I have an ImageButton that I set to R.drawable.btn_on
I don't know how to access the resource directly, but for what you try to achieve, wouldn't it suffice to just get the state?
ImageButton btn = (ImageButton) findViewById(R.id.btn);
int [] states = btn.getDrawableState();
for (int i : states) {
if (i == android.R.attr.state_pressed) {
Log.v("btn", "Button in pressed state");
}
}
http://developer.android.com/reference/android/R.attr.html#state_pressed