Android: How to interact with the default Contacts application

依然范特西╮ 提交于 2019-12-12 05:16:32

问题


I am new and trying to make a code that when a user selects a contact and hits the call button, the user is presented with a pop-up dialog that has two choices; In detail, one is to call using the standard dialer and another one is just another selection for the user.

However, I have no idea how to even interact with the default contacts application. I heard that 'sipdroid' has a similar application but still don't have any idea.

If anybody knows how to do it or has a good tutorial for this, would you please help me?


回答1:


try this.

<activity android:label="@string/app_name" android:name=".YourActivity"
            android:screenOrientation="portrait" android:clearTaskOnLaunch="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER"></category>
                <category android:name="android.intent.category.DEFAULT"></category>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.CALL_BUTTON"></action>
                <category android:name="android.intent.category.DEFAULT"></category>
            </intent-filter>


        </activity>

when you press call button of device then user see two choice ..

1) in-built contacts.
2)your app


来源:https://stackoverflow.com/questions/6120254/android-how-to-interact-with-the-default-contacts-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!