Android - 意图过滤器?

Don*_*rty 13 android intentfilter android-intent

我正在尝试注册我的活动,以便活动选择器/选择器可以使用它,允许用户选择是否选择我的应用程序/活动来完成他们想要做的事情.

我想为用户提供选项,以便能够在他们想要发送短信时选择我的应用程序,当他们想要拨打电话时,为了尝试实现这一点,我在我的Activity标签中添加了以下代码段在我的清单中:

<intent-filter>
<action android:name="android.intent.action.SENDTO" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

但是,活动选择器永远不会出现,并且在不向用户提供选择的情况下使用本机应用程序.任何人都可以看到我错在哪里?

编辑:

我发现我需要添加

<data android:scheme="sms" />
<data android:scheme="smsto" />
Run Code Online (Sandbox Code Playgroud)

对于短信,但我将如何用于拨打电话?

编辑2:

我为传出呼叫尝试了以下内容:

 <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>
Run Code Online (Sandbox Code Playgroud)

但是再次没有运气,这是否被阻止了1.6?

编辑3:

当我点击Text Mobile时会发生这种情况:

替代文字

所以当我点击Call mobile时我想要同样的事情

小智 9

我认为它应该对你有帮助

<intent-filter >
    <action android:name="android.intent.action.CALL_PRIVILEGED" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="tel" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

在Android 2.1上测试过