[英]Call a phone number with android without leaving app
I have an app that, due to lack of mobile data in all areas, uses phone connection to make a phone call. 我有一个应用程序,由于在所有区域都缺少移动数据,因此使用电话连接拨打电话。 There is some important information on the screen in my app, so I want to place the call without leaving my app screen. 我的应用程序的屏幕上有一些重要信息,因此我想拨打电话而不离开我的应用程序屏幕。 Is there any way to do this? 有什么办法吗?
Add the following permission in mainfest file 在mainfest文件中添加以下权限
<uses-permission android:name="android.permission.CALL_PHONE" />
Use the below code to start calling 使用以下代码开始调用
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + "123456789" ));
startActivity(intent);
If you want to implement inside tha app read the tutorial which will help you alot 如果您想在应用程序内实现,请阅读教程 ,这将帮助您很多
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.