Android:How to get back image set for a button programmatically?
<p>I have setup background image for a button as below.</p>

<pre><code>// declarations globally declared...
ImageButton sampleButton;
int sampleFirstImage = 0;
int sampleSecondImage = R.drawable.imageSecond;
......................................
......................................
sampleFirstImage = R.drawable.imageFirst;
sampleButton.setImageResource(sampleImage);
</code></pre>

<p>In certain cases, i want to replace this image with the another second image if the first image is set. As i need to check the condition as first image set or not for button, i need to know what image is already being set for the button. So i want to GET, image set for the button? Is there any API which gets image id set for a control?</p>

<p>Thanks. Appreciate if you know and can explain it to me!</p>
