问题
How can I make a call without/with user interaction.
I found the intent Intent.ACTION_CALL
on the internet, but I want to write program like the one which initiates a call in response of this intent, is this possible? If this is possible, then how can I do this?
I do not want to initiate a dialog to dial for a call, I want to internally make a call in my application.
Is there any java library, which I can use for this purpose?
回答1:
Use Intent. That's how it is designed to work in Android:
try {
startActivity(new Intent(Intent.ACTION_CALL,
Uri.parse("tel:PHONE_NUMBER_HERE" )));
} catch (Exception e) {
e.printStackTrace();
}
This will start dialing.
回答2:
That is not possible from an SDK application.You have to use Intent.ACTION_CALL.
来源:https://stackoverflow.com/questions/13010135/how-to-make-a-call-without-using-intent