Android view Visibility change causes screen to flicker -


i have layout where, on end of video being played, changes visibility of fullscreen imageview visible. whenever happens, screen flickers. there way prevent this?

public class videotestflip extends sherlockactivity implements oncompletionlistener { imageview surprise; videoview video; viewflipper viewflipper; @override public void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.video_splash);     video = (videoview) findviewbyid(r.id.videoview);     viewflipper = (viewflipper)findviewbyid(r.id.viewflipper);     animation in = animationutils.loadanimation(this, r.anim.slide_down);     animation out = animationutils.loadanimation(this, r.anim.slide_up);      viewflipper.setinanimation(in);     viewflipper.setoutanimation(out);     surprise = (imageview)findviewbyid(r.id.surprise);     video.setvideopath("android.resource://com.mezzolab.danariely/raw/" + r.raw.splash_low_5);   video.start();     video.setoncompletionlistener(this); }  @override public void oncompletion(mediaplayer mp) {      surprise.setvisibility(view.visible);      viewflipper.shownext(); } 

i can't see code, lot of time because sequence of events off. check out

edit: code up: did doesn't seem should have flickering behavior. thing can think try , set visible asynchronously. make handler:

private class viewhandler extends handler {   @override   public void handlemessage(message msg) {     surprise.setvisibility(view.visible);   } } 

then call make imageview view.visible calling handler:

mhandler.sendmessage(message.obtain(mhandler, 0)); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -