【问题标题】:Android: opening a choice popup for a call whenever a user callsAndroid:每当用户呼叫时打开呼叫的选择弹出窗口
【发布时间】:2019-08-11 06:00:41
【问题描述】:

大家好,

我正在尝试显示一个弹出窗口,让用户选择用户是要使用标准拨号器还是下面的其他拨号器:

我听说“sipdroid”有类似的功能,“CapDroid”在我上一个问题中给了我一个很好的代码(如下),它在我打电话后显示一个选择弹出窗口,然后挂断强>。


<intent-filter> 
  <action android:name="android.intent.action.VIEW" /
  <category android:name="android.intent.category.DEFAULT" /> 
  <category android:name="android.intent.category.BROWSABLE" /> 
  <data android:mimeType="vnd.android.cursor.dir/calls" /> 
</intent-filter>

我尝试修改此代码以在用户尝试 CALL (例如使用默认联系人或按下主呼叫按钮)时弹出选择对话框,但失败并且仍然不知道该怎么做.

如果有人对此有想法或教程,请给我一个建议吗?

【问题讨论】:

    标签: android android-manifest


    【解决方案1】:

    我找到了解决方案:Android - Intent Filter?

    您允许如下所示的 call_privileged 的​​权限和意图过滤器

    
    <uses-permission android:name="android.permission.CALL_PHONE">
    
    <intent-filter >
        <action android:name="android.intent.action.CALL_PRIVILEGED" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:scheme="tel" />
    </intent-filter>
    

    【讨论】:

      【解决方案2】:

      它应该适合你

      <activity>
        <intent-filter>
          <action android:name="android.intent.action.CALL_PRIVILEGED" />
          <category android:name="android.intent.category.DEFAULT" />
          <data android:mimeType="vnd.android.cursor.item/phone" />
          <data android:mimeType="vnd.android.cursor.item/phone_v2" />
          <data android:mimeType="vnd.android.cursor.item/person" />
        </intent-filter>
      </activity>
      

      在那里阅读for mode detail

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-12-27
        • 2012-06-30
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多