Call in Android application shows add contact dialog

谁说胖子不能爱 提交于 2019-12-20 06:04:44

问题


I'm using this code for calling, in Android application:

Intent callIntent = new Intent(Intent.ACTION_CALL);    
callIntent.setData(Uri.parse("tel:" + call.Number));   
startActivity(callIntent);

but I obtain a dialog like this:

Why no call is make?

P.s: I'm using a Tablet (Acer Iconia A501), not a smartphone.


回答1:


Try this

Make sure :

call to :

 startActivity(new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" +mEditText_number.getText())));

Add permission:

<uses-permission android:name="android.permission.CALL_PHONE" />


来源:https://stackoverflow.com/questions/13624599/call-in-android-application-shows-add-contact-dialog

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