开发者

How to get the number of a chosen contact and pass it to an activity

开发者 https://www.devze.com 2023-03-29 02:30 出处:网络
I have created an app that becomes one of the options whenever we are trying to make an outgoing call. (e.g. \"Complete action using\" (a) dialer (b) skype (c) myApp) I have inserted the CALL_PRIVILEG

I have created an app that becomes one of the options whenever we are trying to make an outgoing call. (e.g. "Complete action using" (a) dialer (b) skype (c) myApp) I have inserted the CALL_PRIVILEGED intent-filter in order to do that.

Here is my AndroidManifest.xml File

    <activity android:name=".OutgoingCallActivity">
        <intent-filter android:priority="999">
            <action android:name="android.intent.action.CALL_PRIVILEGED" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="tel"/>
        </intent-filter>
    </activity>

开发者_StackOverflow中文版Here is my OutgoingCallActivity.java

...
Intent mIntent = new Intent(android.content.Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber) );
    startActivity(mIntent);
...

However, I would like to be able to capture the number of the contact that I have chosen and send it to the activity that I have created.

String phoneNumber = (get the phone number of the contact that I have selected)

How is this possible?


Check the Intent that you receive when starting the OutgoingCallActivity in the debugger, it has to be in there somewhere.

0

精彩评论

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