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
Post a Comment