0
因此,無論何時在任何應用程序中點擊任何數字,將使用該號碼pre-filled
打開默認Dialer
。爲特定種類的數據註冊活動android
如何爲類似的事情註冊我的活動?
哪裏有點擊號碼,還會列出我的應用程序和選擇我的數據呢?
謝謝。
因此,無論何時在任何應用程序中點擊任何數字,將使用該號碼pre-filled
打開默認Dialer
。爲特定種類的數據註冊活動android
如何爲類似的事情註冊我的活動?
哪裏有點擊號碼,還會列出我的應用程序和選擇我的數據呢?
謝謝。
這個意圖過濾器添加到您的活動
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_BUTTON" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<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>
<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>
並添加此權限
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CALL_PRIVILEGED" />
這麼想的工作。仍然直接打開默認撥號程序。 :( – Aps
你在哪裏添加了它? –
在我的清單中的活動聲明中。 – Aps