开发者

Android custom dialler on tapping phone number links

开发者 https://www.devze.com 2023-04-07 07:23 出处:网络
I have to implement custom dialler application. Well it will not make regular phone call, instead it will connect to some service to estabilish VoIP connection. That is simple part I think I can handl

I have to implement custom dialler application. Well it will not make regular phone call, instead it will connect to some service to estabilish VoIP connection. That is simple part I think I can handle it. But the other part is a bit tricky for me. I want to "register" my dialler somehow in the system to have it in context menu when you click on a phone number link in an e-mail for example. Now, when you click the number, default dialler appears. I want context menu to be shown where you can select if you want to use phone or my dialler. Is it possible? Can someone provide me some more tips?

OK. I know I have to create some intent-filter for that. Here is what I did but it does not work. Still no "My App" in the context menu when clicking phone number in some e-mail message.

<intent-filter an开发者_如何学JAVAdroid:priority="100">
    <action android:name="android.intent.action.CALL_PRIVILEGED" />
    <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" />
    <data android:scheme="callto" />
</intent-filter>


Tha answer for your question is:

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

精彩评论

暂无评论...
验证码 换一张
取 消