该图像在应用程序屏幕之间的切换中可见

该图像在应用程序屏幕之间的切换中可见

本文介绍了自定义Android应用程序屏幕图像,该图像在应用程序屏幕之间的切换中可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在我的应用"处于后台模式时,即当用户在最近使用的应用"中的应用"之间进行导航时,将我的应用的图像"自定义为主屏幕"图像,该选项可以看到所有正在运行的应用的小屏幕快照.

I'm wondering how to customize the Image for My App to Home Screen image when My app is in background mode, that is when user navigates between Apps in recent apps option where a small screen shot for all running apps is visible.

例如:图像已附加,更加清晰.

Eg: Image Attached for more clarity.

推荐答案

请参阅以下问题:

因此,从理论上讲,有两种可能的解决方案:

So theoretically there are two potential solutions:

  1. 覆盖 Activity.onCreateThumbnail() 自定义缩略图.
  2. 在窗口中添加 FLAG_SECURE 到防止缩略图(和屏幕截图).

Activity.onCreateThumbnail()听起来很棒,直到您意识到自方法调用被注释掉以来,自Android 4.0.3起它就被打破了.请参阅上面的帖子或直接发表,请参见 Android源代码:

Activity.onCreateThumbnail() sounds awesome until you realize it's been broken since Android 4.0.3 when the method call was commented out. See above posts or be direct, see the Android source code:

// First create a thumbnail for the activity...
// For now, don't create the thumbnail here; we are
// doing that by doing a screen snapshot.
info.thumbnail = null; //createThumbnailBitmap(r);

当前,没有简单的方法可以自定义缩略图.

Currently, there is no easy way to customize the thumbnail.

所以实际上只剩下FLAG_SECURE.这不允许您自定义缩略图,但是会阻止缩略图,例如密码表和敏感信息.使用该标记有一个缺点-它还会阻止屏幕截图,屏幕截图和镜像显示.

So that really only leaves FLAG_SECURE. This doesn't allow you to customize the thumbnail, but rather prevents it, e.g. password forms and sensitive information. There's a downside to using the flag- it will also prevent screenshots, screen capture, and mirrored displays.

这篇关于自定义Android应用程序屏幕图像,该图像在应用程序屏幕之间的切换中可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 02:31