在弹出来向呼叫屏幕来向、屏幕、在弹出

2023-09-12 06:10:41 作者:星月故里

我想创建一个自定义弹出在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:

部分的更多信息

在半透明的主题,没有工作,因为它取消了前活动的点击的。 干杯是不是一种选择 - 我不希望它消失。 我知道有很多类似的帖子 - 我读了很多人,并没有回答我的具体的问题。 我已经知道如何使事情发生一旦通话接收器,因此无需INCOMING_CALL活动的提示。

请问AP preciate任何帮助! 谢谢

Would appreciate any help! Thanks

推荐答案

如果你想保持通话活动仍然可点击,但不会对您的覆盖任何控件,您可以通过调用做到这一点

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.

布局参数可用与此有:

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