让Android应用程序出现在默认应用程序列表中?
我有一个“电话”应用程序的源代码,可以拨打号码并拨打电话。当用户选择任何“电话”快捷方式时,如何使其在可用应用程序列表中可见?
我尝试实现操作意图过滤器 android.intent.action.CALL
和 android.intent.action.CALL_PRIVILEGED
但它仅在我拨打电话后在列表中显示我的应用程序数字。换句话说,我的应用程序被归类为拨号器而不是电话。
我需要实现任何特定的 BroadcastReceiver
吗?我该怎么做?
I have the source code of a 'Phone' app that dials a number and makes a call. How do I make it visible in a list of available applications when a person chooses any 'Phone' shortcut?
I have tried implementing the action intent filters android.intent.action.CALL
and android.intent.action.CALL_PRIVILEGED
but it only shows my app in the list AFTER I dial a number. In other words, my app gets classified as a Dialer rather than a Phone.
Is there any specific BroadcastReceiver
that I need to implement? How do I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信这个答案可能就是您正在寻找的。因此,本质上,您首先需要在要进行调用的活动上设置一个 Intent 过滤器(在
AndroidManifest.xml
中):这应该让您的用户可以在拨打电话时选择使用您的应用程序,与 csipsimple 的工作原理类似。
I believe this answer is probably what you're looking for. So essentially you'll first need to setup an intent filter on the activity that's going to make the call (in
AndroidManifest.xml
):This should give your user the option to use your app when placing calls, similarly to how csipsimple works.
好吧,因为我的评论是OP所要求的,所以我在这里复制它。
“您是否尝试过 CALL_BUTTON(作为清单中的意图过滤器)?”
well since my comment was what the OP asked for, i replicate it here.
"have you tried CALL_BUTTON (as an intent filter in your manifest) ?"