java - button.setPressed(true) suddenly not working -
i have been using emulator following code press particular button
redbut.performclick(); redbut.setpressed(true); redbut.invalidate(); redbut.setpressed(false); redbut.invalidate();
using log statements, know sure piece of code being called, not code being skipped over.
on emulator, button appeared pressed if user pressed it. on real android device, process running button unchanged. problem?
write code follows-
redbut.performclick(); redbut.setpressed(true); redbut.invalidate(); new handler().postdelayed(new runnable() { @override public void run() { redbut.setpressed(false); redbut.invalidate(); } }, 500);
Comments
Post a Comment