2011-05-26 19 views
0

您好所有,安卓:打開一個彈出選擇一個呼叫,每當用戶調用

我試圖展示一個彈出來讓

http://img121.imageshack.us/img121/9889/111iav.png

聽說「sipdro:如果用戶想使用標準的撥號器或另外一個類似下面的用戶選擇ID'有一個類似的功能,'CapDroid'給了我一個很好的代碼(在下面)從我最後一個問題,這表明我彈出一個選擇後彈出,然後HANG UP


<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喜歡使用默認的聯繫人或按主呼叫按鈕,彈出選擇對話框,但失敗了,仍然不知道該怎麼做。

如果有人有這方面的想法或教程,請給我一個建議?

回答

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> 
0

它應該爲你

<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合作意向過濾器。

相關問題