在来电屏幕上弹出 [英] Popup over incoming-call screen

查看:37
本文介绍了在来电屏幕上弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 android 的来电屏幕上创建一个自定义的弹出窗口,我希望在其中为用户添加信息.我希望弹出窗口不会从后台禁用任何可点击性,以便用户仍然可以接听电话.

I want to create a customized popup over the android's incoming call screen where I wish to add information for the user. I want the popup to not disable any clickability from the background so that the user could still answer the call.

我知道这是可能的,因为许多应用程序都这样做,例如MeZeZe 应用:

I know it is possible since many applications do it, e.g. MeZeZe app:

更多信息:

  1. 半透明主题无效,因为它取消了前一个活动的可点击性.
  2. 敬酒不是一种选择 - 我不希望它消失.
  3. 我知道有很多类似的主题 - 我阅读了很多,但没有一个能回答我的具体问题.
  4. 我已经知道如何在接听电话后让事情发生",因此不需要 INCOMING_CALL 活动提示.

希望得到任何帮助!谢谢

Would appreciate any help! Thanks

推荐答案

如果您想保持 Call 活动仍然可点击,但在您的叠加层上没有任何控件,您可以通过调用来实现

If you want to keep the Call activity still clickable, but not have any controls on your overlay, you can do this by calling

getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);

在调用中显示的活动的 onCreate() 方法中.

In the onCreate() method of the activity that is shown over the call.

可与此一起使用的布局参数是:

The layout parameters useable together with this are:

android:windowBackground="@android:color/transparent" 
android:windowIsTranslucent="true" 
android:windowAnimationStyle="@android:style/Animation.Translucent"

这篇关于在来电屏幕上弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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