我在android中創建了一個自定義撥號程序,顯然是項目需求。所以我的問題是,當用戶撥打一些他應該看到的號碼時,可以選擇使用默認撥號程序的自定義撥號程序。如果他選擇我的撥號程序,他應該重定向到我的自定義撥號程序。那麼如何將我創建的自定義撥號器註冊到android?Android中的撥號程序問題
Regards, Shishir Shetty。
在此先感謝。
我在android中創建了一個自定義撥號程序,顯然是項目需求。所以我的問題是,當用戶撥打一些他應該看到的號碼時,可以選擇使用默認撥號程序的自定義撥號程序。如果他選擇我的撥號程序,他應該重定向到我的自定義撥號程序。那麼如何將我創建的自定義撥號器註冊到android?Android中的撥號程序問題
Regards, Shishir Shetty。
在此先感謝。
此密碼正在使用
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".MyDialerApplication"
android:label="@string/app_name" >
<intent-filter android:priority="100" >
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.DIAL" />
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
</activity>
</application>
但有一個問題,這是不顯示應用程序菜單中的應用程序。 請問,我如何設置應用程序動作主要以及撥打
您是否編輯過清單以讓您的活動處理這些事件? 它類似於這樣:
<activity ...>
<intent-filter android:priority="100">
<action android:name="android.intent.action.DIAL"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel"/>
</intent-filter>
</activity>
一個完整的例子可以在這裏找到:http://mobileorchard.com/android-app-development-intents-and-intent-filters/
添加到您的活動意圖過濾器。
<intent-filter ><action android:name="android.intent.action.CALL_PRIVILEGED" /><category android:name="android.intent.category.DEFAULT" /><data android:scheme="tel" />
希望這有助於..
你只需要一個意圖過濾器添加到您的清單,這樣的:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
還有其他的選擇,在一些長度在這裏解釋說:http://developer.android.com/reference/android/content/Intent.html