Show in-call dialpad - Dial a number during call - DTMF
Asked Answered
N

1

9

I want to dial a number after I have answered a call, normally done by the in-call dialpad.

I tried the following, but that starts dialing a new call instead (so does ACTION_VIEW).

Intent dial = new Intent(Intent.ACTION_DIAL);
dial.setData(Uri.parse("tel:9"));
startActivity(dial);

My guess is that "tel:" triggers a new dialing sequence. What I probably need is to show the in-call dialpad and simulate key strokes.

Anyone?

Edit: I found this question Starting the InCallScreen activity which makes me think that I need to just send a keydown event to 'com.android.phone.InCallScreen', but I am not sure how to do that. Also this is a directly related issue that has been (and still is) open for years: http://code.google.com/p/android/issues/detail?id=1428

Novikoff answered 12/4, 2012 at 21:30 Comment(1)
As far as I can tell, there's no functionality in the public API for this. There were some proposed changes to TelephonyManager to allow this, but they seem to have stalled.Segregationist
L
0

Nope. It isn't the tel: that triggers a new call, but rather the fact that you are creating a new Intent, and then running startActivity(dial);

Think about what this means: You are starting a brand new activity, so it can't interact with the phone-related activity your previous code is using.

I think what you are really trying to do is add a number to then end of what you are dialing. To do this, you need to put your entire number, plus a pause character (p) in the URI data, and use ACTION_CALL. Code:

Intent dial = new Intent(Intent.ACTION_CALL);
dial.setData(Uri.parse("tel:7195555555ppp9"));
startActivity(dial);

I did three pauses, you should adjust based on how long it takes. Alternately, use the wait character (w), but this seems to require confirmation from the user to send the extra digits.

Lacuna answered 1/12, 2012 at 22:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.