0

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?

June
  • 265
  • 1
  • 8
  • 21

1 Answers1

0

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
Niranj Patel
  • 32,980
  • 10
  • 97
  • 133
  • Hello CapDroid. Thanks for your quick reply. I just created a test project and modified my main activity commands in AndroidManifest.xml same to yours. However, when I go to the default Contacts app, click a contact and call, it just directly moves onto the dialer. If you don't mind, would you help me little bit more? – June May 25 '11 at 06:43
  • we cant do that.. Your app will be open on call button of device (Hard Button)try to press call button of device... – Niranj Patel May 25 '11 at 06:45
  • Hi again, CapDroid. Thank you for your code. I see it gives me an option when I press the call button of the device. And I see you mentioned that we can't do what I want. I really appreciate your help, however, if you don't mind, would you give me just one more advice? I heard that 'sipdroid' has a code that opens a selection popup whenever a user tries to call with any methods. So, isn't there any intent-filter command(or any other command) that offers me a popup to choose whenever the user tries to call(no matter what method he uses to call)? – June May 25 '11 at 06:59
  • try this,, but i didnt used it, so i dont know it will be work or not. – Niranj Patel May 25 '11 at 07:07
  • Thanks for your continued help, CapDroid. I just tried your code and somehow it was so close! Though it didn't entirely work, I could see a selection dialog whenever I call and then hang up. Do you think there's a way to just modify this little bit to work it after I press the call button not hang up button? I'm also searching for this. – June May 25 '11 at 07:22
  • I appreciate your help. I'll try more to find a way. Thanks! – June May 25 '11 at 07:35