隐藏概览/最近屏幕中的屏幕截图

时间:2017-02-03 03:06:15

标签: android security screenshot screen-capture

当Android为应用程序提供背景时,它会创建当前屏幕的屏幕截图。单击“概述”按钮时将显示屏幕截图。

有没有办法阻止这个后台屏幕截图(好像我使用过FLAG_SECURE),但允许用户截取屏幕截图?

2 个答案:

答案 0 :(得分:0)

您可以配置不在最近列表中显示您的活动。在清单中添加以下代码:

$doR = $totalArr[$i]['RealDate'];
$start = strtotime($doR);
$today = time();

// change it like this:
$diff = ($today-$start)/(60 * 60 * 24);

if($diff < 5){
    $parole = "<span style=\"color:red\"> - ON PAROLE</span>";
}

或者来自java代码startActivity with flag:

    <activity
        .....
        android:excludeFromRecents="true"
        ...../>

或者,

intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);

答案 1 :(得分:0)

尝试这个https://stackoverflow.com/a/49442984/5939067

上面的解决方案只是在应用程序进入后台时设置安全标志,并在应用程序恢复运行时将其清除(因此您可以在使用应用程序时截取屏幕截图)。

对我来说效果很好。我在Samsung Galaxy 9+(Android 9),LG V30(Android 8)和LG G7 ThinQ(Android 8)上进行了测试。

相关问题