-2
我想通過Android中的應用程序打電話,不會顯示顯示。這裏是我的代碼:Android意圖電話呼叫
Intent intent = new Intent(Intent.ACTION_CALL_BUTTON).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setData(Uri.parse("tel:" + "+XXX")); intent.putExtra("com.android.phone.extra.slot", 0);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED)
{ // TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding // public void onRequestPermissionsResult(int requestCode, String[] permissions, // int[] grantResults) // to handle the case where the user grants the permission. See the documentation // for ActivityCompat#requestPermissions for more details. return; }
getApplicationContext().startActivity(intent);
}
,並表示這個錯誤:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.CALL_BUTTON dat=tel:xxxxxxxxxxxxxx flg=0x10000000 (has extras) }
我該怎麼辦?