change image on click!!


Last Updated:

  1. wounded

    wounded Active Member

    hi all ,
    hope all are fine
    i want to change image to another image or video by click ??!
    anybody know to help plz

    Advertisement
  2. jonbonazza

    jonbonazza Well-Known Member

    Code (Text):
    1.  
    2.  
    3. make your class implement View.OnClickListener, then override the following method as so.
    4. @Override
    5. public void onClick(View v) {
    6.  
    7.     if (v == myButton)
    8.         imageView.setImageResource(R.drawable.my_resource);
    9. }
    10.  
  3. wounded

    wounded Active Member

    yeah ,thank you

Share This Page