Hi,

I am trying to use ImageView object and dynamically display the image
based on what was returned from the selected item. However this code
is not working. It is not able to change the default image to image
cabA in the ImageView object when cab_str equal to CabA. Can anyone
advise me on how I should go about debugging this?


Thanks in advance.

public   void  onClick(View v)
{
          String  cab_str = (String) s.getSelectedItem();
          ImageView cabImage = (ImageView)findViewById(R.id.cabimage);

          if (cab_str.equals("CabA"))
                    cabImage.setImageResource(R.drawable.cabA);

}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to