textview - How to highlight text background color for duration?[android] -


i m making narrative app children, every word highlighted , prononounced. words take longer prononounce, need keep them highlighted bit longer.

    play = (imagebutton)findviewbyid(r.id.play);     textview grandmom = (textview)findviewbyid(r.id.grandmom) ;      play.setontouchlistener(new view.ontouchlistener() {         @override         public boolean ontouch(view v, motionevent event) {             if(motionevent.action_down == event.getaction()){                 grandmom.setbackgroundcolor(color.yellow);                 return  true;             }         }     }); 

the code above highlights word , keeps yellow forever. how light few milliseconds , put normal?

you can use asynctask play sound. change background yellow in onpreexecute(), , set normal in onpostexecute()

that way won't have worry time takes play sound.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -