Okay Mark. Thanks a lot. I finally got it! On Sun, Apr 3, 2011 at 2:08 AM, Mark Murphy <[email protected]> wrote:
> On Sat, Apr 2, 2011 at 4:27 PM, Raghav Sood <[email protected]> wrote: > > Sorry Mark. I am 13 years old and a little confused. Please try just once > > more. I need to find out what image is currently in the image view. How > can > > I do that? Just try once more. > > :: sigh :: > > There are many possible ways an image can get in an ImageView. An > image resource, like R.drawable.whatever, is only one of them. Hence, > there is no way to ask an ImageView what drawable resource it holds. > > You are the one who is putting drawable resources into the ImageView, > whether through a layout file or through setImageResource(). Hence, to > know what drawable resource is in the ImageView, every time you set > the drawable resource, also make note *in a separate int data member* > what resource you put in there. Then, when you need to make the > comparison, check what is in the separate data member. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > _The Busy Coder's Guide to *Advanced* Android Development_ Version > 1.9.2 Available! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Raghav Sood http://www.raghavsood.com/ http://www.androidappcheck.com/ http://www.telstop.tel/ -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

