为什么我的应用程序没有拨打电话?

时间:2014-10-12 12:14:33

标签: android call

我按照此帖子中的代码How to make a phone call in android and come back to my activity when the call is done?

进行了操作

我的代码如下:

按下按钮时:

   Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("1337")); 

我还添加了

 android:name="android.permission.CALL_PHONE"> to user permissions

但按下按钮时没有任何反应。

1 个答案:

答案 0 :(得分:2)

只需在号码中添加 tel:前缀即可。我:...(Uri.parse("tel:" + Number));

然后添加以下行:

intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

现在您已准备好启动系统"呼叫活动"通过你的意图:
类似的东西:

getApplicationContext().startActivity(intent);
相关问题