简体   繁体   English

如何将某些标志添加到我的Intent.ACTION_CALL?

[英]How can i add certain flags to my Intent.ACTION_CALL?

i built an activity that can launch itself when i hit a certain button-combination on my locked screen. 我建立了一个活动,当我在锁定的屏幕上按下某个按钮组合时,该活动可以启动。 I also managed to keep the activity running despite pressing the powerButton two times --> screen off and screen on --> activity is still running and keyguard still retired from duty. 尽管两次按下powerButton,我也设法使活动保持运行->关闭屏幕并打开屏幕->活动仍在运行,并且键盘锁仍退役。 This is done by adding flags in the onCreate()-method of my activity. 这是通过在活动的onCreate()方法中添加标志来完成的。

 i.e. getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);

Now i want to achieve the same with the Intent.ACTION_CALL. 现在我想用Intent.ACTION_CALL达到相同的目的。 But the problem is that i can't override any method of that intent as it seems to be exclusively run by android. 但是问题是我无法覆盖任何意图的方法,因为它似乎是由android独占运行的。 Also, adding flags to the intent before i hit startActivity doesn't work as i can't use the necessary flags here. 另外,在我点击startActivity之前向意图添加标志是行不通的,因为我不能在这里使用必要的标志。

Does anyone have an idea how i can achieve it? 有谁知道我该如何实现?

If I understood correct, you want to make another activity, you starting with Intent.ACTION_CALL action, to add some flags to it's window. 如果我理解正确,那么您要进行其他活动,您可以从Intent.ACTION_CALL动作开始,向其窗口添加一些标志。

It's not possible on Android. 在Android上是不可能的。 It means another app should give everyone rights to control itself in order to do this. 这意味着另一个应用程序应授予所有人控制自己的权限,以便执行此操作。

You can only add flags to Intent for controlling new activity start and tasking options. 您只能向Intent添加标志以控制新的活动开始和任务选项。 See official documentation , you can use flags, that starts with FLAG_ACTIVITY 请参阅官方文档 ,可以使用以FLAG_ACTIVITY开头的标志

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM