
Intent callintent = new Intent(Intent.ACTION_CALL); callintent.setData(Uri.parse("tel:100")); callintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); ctx.startActivity(callintent); 在AndroIDManifest.xml中添加了CALL_PHONE权限.问题是它在拨号盘上打开100而不是直接打电话.我想在用户点击按钮时立即发生这种情况.
当我试图在100之前输入91时,它会自动调用该数字,但为什么这些数字需要加号.所以有人帮我解决了这个问题
解决方法 从ACTION_CALL的文档:Note: there will be restrictions on which applications can initiate a call; most applications should use the ACTION_DIAL.
Note: this Intent cannot be used to call emergency numbers. Applications can dial emergency numbers using ACTION_DIAL,however.
所以看来这种行为是故意的.
总结以上是内存溢出为你收集整理的如何直接在Android中拨打电话全部内容,希望文章能够帮你解决如何直接在Android中拨打电话所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)