从最近的应用程序菜单替换图像 [英] Replace image from recent app menu
问题描述
在我的应用中,有一些活动正在显示用户敏感数据(收件箱,密码,银行帐户余额等).这些部分当然受密码保护,并且一段时间后(在onRestart()中选中),用户将自动注销.问题是,当此应用程序在Android 3.0+上运行时(该应用程序具有带有近期应用程序图像的近期应用程序菜单),这些敏感数据在此菜单中可读.有没有办法将该图像更改为应用程序徽标或其他内容?
我已经尝试过使用EXCLUDE_FROM_RECENTS标志在新任务中启动这些部分,这有助于但正在干扰用户体验.
其他选项位于onPause()方法中,尝试启动某种徽标活动",该活动将在onRestart()中停止,并显示在最近的应用菜单中.
还有其他/更好的建议吗?谢谢!
In my app are activities which are displaying user sensitive data (inbox, passwords, bank account balance etc.). These sections are of course password protected and user is automatically logged off after some amount of time (this is checked in onRestart()). Problem is when this app is running on Android 3.0+ (which has recent app menu with images of recent apps) that these sensitive data are readable in this menu. Is there way to change that image to application logo or something else?
I already tried starting those sections in new task with EXCLUDE_FROM_RECENTS flag which helped but is interupting the user experience.
Other option is in onPause() method try to start some sort of "logo activity" which will be stopped in onRestart() and will be shown in recent app menu.
Any other/better suggestions? Thanks!
推荐答案
是否可以将该图像更改为应用程序徽标或其他内容?
Is there way to change that image to application logo or something else?
在窗口中添加 FLAG_SECURE
可以处理此问题,IIRC:
Adding FLAG_SECURE
to the window handles this, IIRC:
public class FlagSecureTestActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(LayoutParams.FLAG_SECURE,
LayoutParams.FLAG_SECURE);
setContentView(R.layout.main);
}
}
这还会阻止具有屏幕截图支持的ICS设备上的屏幕截图.
This also blocks screenshots on ICS devices with screenshot support.
这篇关于从最近的应用程序菜单替换图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!