在 Android 中从通话屏幕显示 AlertDialog

发布于 2024-09-18 13:27:46 字数 298 浏览 2 评论 0原文

我想在用户发起呼叫时在呼叫屏幕中显示警报。

目前我有:

  • MyAlert 类扩展 Activity 来查看和处理警报
  • CallReceiver 类扩展 BroadCastReceiver 来处理呼叫

从 CallReceiver 中,我使用 MyAlert 上的 startActivity 启动警报。问题是警报出现在我的主要活动中,所以我们没有在正确的时间看到它,但只有当我们打开应用程序时才看到它,这是完全无用的。

如果有人有任何想法,这会对我有很大帮助;我失去了希望!

I want to display an alert in the call screen when the user initiates a call.

Currently I have:

  • A class MyAlert extends Activity to view and process the alert
  • A class CallReceiver extends BroadCastReceiver to process the call

From CallReceiver, I launch the alert with startActivity on MyAlert. The problem is that the alert appears in my main activity, so we don't see it at the right time, but only if we open the app, which is totally useless.

If anyone has any ideas, it would help me a lot; I lost hope!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

_失温 2024-09-25 13:27:46

呼叫屏幕是单独应用程序的一部分。这意味着您必须修改该源并安装才能获得所需的功能。我相信 WhitePAges 应用程序确实可以做到这一点。

Call Screen is part of a separate application. Which means you would have to modify that source and install to get your functionality desired. The WhitePAges app I believe in fact does this..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文