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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -