随着活动的安全键盘保护活动的转变是怪异 [英] With security keyguard active transition between activities is weird

查看:167
本文介绍了随着活动的安全键盘保护活动的转变是怪异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的主要活动A和当用户presses一个按钮,我打开另一个活动B.但是,当这种情况发生B不只是出现在顶部:

I have my main activity A and when the user presses a button i open another activity B. But when this happens B doesn't just appear on top of A:

  • 系统将消失
  • 安全锁键盘显示了
  • 出现在B

当我摆脱B的同样的事情发生。这是讨厌的,因为有很多在屏幕上没有什么实际意义闪烁的。有没有办法实现了从A到B的直接过渡,而且键盘锁是活动的,而不合并2活动分为1?

And when i get rid of B the same thing happens. This is annoying because there's a lot of flickering with no real purpose on the screen. Is there any way to achieve direct transition from A to B while keyguard is active without merging the 2 activities into 1?

下面是我在做什么在的onCreate两个活动:

Here is what i'm doing in onCreate for both activities:

getWindow().addFlags(
        WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
                | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
                | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);

和这里是我开始的活动:

And here is how i start the activity:

        final Intent intent = new Intent(Sand.this, EditRule.class);
        intent.putExtra(DB.KEY_PARENT_ID, id);
        intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
        startActivityForResult(intent, 0);
        overridePendingTransition(0, 0);

我也尝试设置一个空的android:在活动主题,但没有运气windowAnimationStyle

I also tried setting a null android:windowAnimationStyle in the activity theme but no luck.

更新:我提交了这个bug: 的https://$c$c.google.com/p/android/issues/detail?id=68465&thanks=68465&ts=1397301860

UPDATE: i submitted this bug: https://code.google.com/p/android/issues/detail?id=68465&thanks=68465&ts=1397301860

谢谢, 张志贤

推荐答案

我看着这个广泛(一对夫妇其他工程师)一年多前在ICS和JB。这是不可能避免闪烁,我强烈怀疑仍然在奇巧的情况。你应该文件问题。

I looked into this extensively (with a couple other engineers) a year or so ago on ICS and JB. It was not possible to avoid the flicker, which I strongly suspect is still the case in KitKat. You should file that bug.

(如果你看一下在Android上的键盘锁相关的源代码,这是一个相当... 巨额的code /政策充满了特殊情况下,大规模因为这种情况下没有明确记载在任何地方,即使你能得到它的工作的一个版本,我不会依赖于它的工作始终。)

(If you look at the Keyguard-related source in Android, it's a rather.. hefty mass of code/policy riddled with special cases. Since this case isn't explicitly documented anywhere, even if you can get it to work on one version, I would not rely on it working consistently.)

最后,我们用我们所有的必不闪烁锁屏界面组合成一个单一的活动工作解决此问题。这是不愉快的,但它的工作。

Ultimately, we worked around the issue by combining all of our must-not-flicker lockscreen UI into a single Activity. It was unpleasant, but it worked.

这篇关于随着活动的安全键盘保护活动的转变是怪异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆