Reputation: 67
I have a button. I want to simulate a click on. performClick()
does most of the job, but it doesn't do the button's animation. I tried setPressed
and setEnabled
as well, but no dice.
Upvotes: 0
Views: 3709
Reputation: 11568
Call invalidate after the setPressed to force the view to redraw:
btn.setPressed(true);
btn.invalidate();
Upvotes: 7