Answer the question
In order to leave comments, you need to log in
How to answer an incoming call from a custom activity?
With grief in half, I figured out how to spit out my activity on top of the native incoming call window:
new Handler().PostDelayed(() =>
{
Intent callIntent = new Intent(context, typeof(CallActivity));
callIntent.AddFlags(ActivityFlags.NewTask);
callIntent.SetFlags(ActivityFlags.NewTask);
callIntent.PutExtra("Number", intent.GetStringExtra(TelephonyManager.ExtraIncomingNumber));
context.StartActivity(callIntent);
}, 1500);
Intent button = new Intent(Intent.ActionMediaButton);
button.PutExtra(Intent.ExtraKeyEvent, new KeyEvent(KeyEventActions.Down, Keycode.Headsethook));
SendOrderedBroadcast(button, "android.permission.CALL_PRIVILEGED");
Answer the question
In order to leave comments, you need to log in
There is no official documented API for this as far as I know. It all depends on the firmware.
You need to fence your crutch for each device. In total, there are a dozen and a half methods of raising the tube, probably.
Once I found examples on github, look there.
Or decompile any sane caller from the market, see how they do.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question