how to make a call, without using intent

泪湿孤枕 提交于 2019-12-11 09:07:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!