title: Android: Customizing recent apps thumbnail (screenshot by default)
body: <p>The app I'm working on shows some sensitive information that must not be shown on the "Recent Tasks" screen when stopping the app by pressing the home button.</p>
  
  <p>I'd like to blur the sensitive data in the screenshot or <strong>show the app logo instead</strong>.</p>
  
  <p>I am aware of the following approaches but they don't fit my requirements:</p>
  
  <ul>
  <li>Setting the actvitie's <code>android:excludeFromRecents</code> to true in the manifiest prevents the app from being shown at all in the recent tasks. This would disrupt the user experience.</li>
  <li>Using <code>FLAG_SECURE</code> results in a blank card on the recents tasks screen. (<a href="https://stackoverflow.com/questions/9822076/how-do-i-prevent-android-taking-a-screenshot-when-my-app-goes-to-the-background">How do I prevent Android taking a screenshot when my app goes to the background?</a>) I don't like the blank screen. However, I'll stick to this solution if there is no workaround.</li>
  <li>Overriding <code>onCreateThumbnail</code> seems like the ideal solution but, unfortunately, doesn't work as it's currently not invoked by the OS :( (<a href="https://code.google.com/p/android/issues/detail?id=29370" rel="noreferrer">https://code.google.com/p/android/issues/detail?id=29370</a>)</li>
  </ul>
  
  <p>And then there are some workarounds that I tried out but that didn't work as hoped:</p>
  
  <ul>
  <li>Start a new activity that shows the app logo in <code>onPause</code> so that it's screenshot is shown instead of the actual activitie's one. But the new activity takes too long to open and it disrupts the user experience.</li>
  <li>Set the activitie's content view to an image of the app logo in <code>onPause</code>. That seemed like a great solution to me. Unfortunately, the screenshot for the recent tasks screen is taken at an unspecified time. During testing the app logo quickly appears before the app is closed when pressing 'Home' but the resulting screenshot shows the activity a short time before that.</li>
  <li>Removing the sensitive data from the widgets (e.g. <code>textView.setText("")</code>) has the same problem of screenshot timing just mentioned.</li>
  </ul>
  
  <p>Any alternative ideas or solutions to the listed workarounds?</p>