为什么ACTION_CALL不能在Android 5上以编程方式进行调用?

时间:2016-08-06 15:27:32

标签: android

问题是我没有收到任何错误,但它也没有拨打电话。它在Android KitKat上工作正常,但在我的Lenovo Lollipop(5.0)上没有。

try {
      String contact_number="1234567891";
      Intent callIntent = new Intent(Intent.ACTION_CALL);
      callIntent.setData(Uri.parse("tel:" + contact_number));
          startActivity(callIntent);
    } catch (Exception e) {
          Toast.makeText(getApplicationContext(),e.toString(),Toast.LENGTH_SHORT).show();
    }

在清单文件中,我声明了:

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

0 个答案:

没有答案