title: Android - Views overlaid on the last frame of a fullscreen video don't redraw properly when turning the screen on and off
body: <p>I have a video that plays in portrait mode. At the end of the video, I need to display some views over it. This works fine so far.</p>
  
  <p>I am however, having a problem where views that are over the last frame of a video don't redraw properly when coming back to the activity after turning the screen off, then on again, then unlocking the screen. </p>
  
  <p>What i'm observing is that when the screen comes back on and I unlock. My video and images are first rendered outside of fullscreen mode (with the status bar still showing) then the screen will go into fullscreen mode shifting all of the views up and causing artifacting.</p>
  
  <p>It seems like the views are being shifted out of their view bounds by the transition to fullscreen after they are rendered. </p>
  
  <p>I'm really stumped as to how to prevent this from happening. </p>
  
  <p><a href="https://github.com/takn/video_artifacting_sandbox" rel="noreferrer">Here is the sandbox project on github </a> to avoid making this a post full of code. </p>
  
  <p>The basic setup for the project is this:</p>
  
  <p>Fragment activity has a video view and a button view on it's layout.
  It then adds a fragment into a contentView container. The contentView fades in 1 second prior to the end of video playback. </p>
  
  <p>Everything works smoothly and the problem is with returning back to the app after powering the screen on and off. </p>
  
  <p>Also, sometimes the video will just drop out entirely, leaving the views sitting atop a black background.</p>
  
  <p>Thanks in advance for any help you can provide. </p>
  
  <p><img src="https://i.stack.imgur.com/NB74m.png" alt="proper rendering of views over video"></p>
  
  <p>Here's the artifacting that happens when you turn the screen off, back on, and unlock.
  Note that I had to take a picture of it. On DDMS the screenshot tool sees the images properly. </p>
  
  <p><img src="https://i.stack.imgur.com/17SQX.jpg" alt="artifacted image"></p>