Selectors using Buttons [closed]
I am Having 2 images and single button. By clicking on the button images need to be loaded by using selectors?
use this coding
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Drawable d1 = iv1.getDrawable();
Drawable d2 = iv2.getDrawable();
iv1.setImageDrawable(d2);
iv2.setImageDrawable(d1);
}
}
});
精彩评论