我目前有一个布局,在播放视频结束时,将全屏图像视图的可见性更改为可见。每当发生这种情况时,屏幕都会轻微闪烁。有没有办法防止这种情况?
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();
}