【问题标题】:Android custom dialler on tapping phone number linksAndroid自定义拨号器点击电话号码链接
【发布时间】:2011-09-23 19:48:17
【问题描述】:

我必须实现自定义拨号器应用程序。好吧,它不会拨打常规电话,而是会连接到某些服务以建立 VoIP 连接。这是简单的部分,我想我可以处理它。但另一部分对我来说有点棘手。例如,当您单击电子邮件中的电话号码链接时,我想以某种方式在系统中“注册”我的拨号器,以便将它放在上下文菜单中。现在,当您单击号码时,会出现默认拨号程序。我希望显示上下文菜单,您可以在其中选择是否要使用电话或我的拨号器。是否可以?谁能给我更多提示?

好的。我知道我必须为此创建一些意图过滤器。这是我所做的,但它不起作用。单击某些电子邮件中的电话号码时,上下文菜单中仍然没有“我的应用程序”。

<intent-filter android:priority="100">
    <action android:name="android.intent.action.CALL_PRIVILEGED" />
    <action android:name="android.intent.action.DIAL" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="tel" />
    <data android:scheme="callto" />
</intent-filter>

【问题讨论】:

    标签: android contextmenu intentfilter phone-number phone-call


    【解决方案1】:

    你的问题的答案是:

     <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <action android:name="android.intent.action.DIAL" />
                <category android:name="android.intent.category.DEFAULT" /> 
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="tel" />
            </intent-filter>
    

    【讨论】:

    • 嗨 Hrabia,我也在尝试开发相同类型的应用程序。它不适合我。我已经尝试过解决方案,但我无法激活活动。你能帮我分享一些关于这样做的方法的更多信息吗?
    • 您必须将所有行按相同的顺序排列。否则将无法正常工作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-15
    • 2012-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多