[英]No Activity found to handle Intent{ act=android.intent.action.CALL dat=Phone number:1 }?
My program compiles, and works on everything it proposes, except when I try to use the phone call feature, it breaks. 我的程序可以编译,并且可以处理它提出的所有内容,但当我尝试使用电话功能时,它会中断。 I've already changed the manifest
, the Activity
, and the main class, entered the necessary permissions, but it does not work. 我已经更改了manifest
, Activity
和主类,并输入了必要的权限,但是它不起作用。 The error occurs at line 50 of this code: https://ideone.com/JrdBrp . 该代码的第50行出现错误: https : //ideone.com/JrdBrp 。 The class is called StudentCall
. 该类称为StudentCall
。
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_GRANTED) {
startActivity(it);//line 50
}
}
The error message is: "android.content.ActivityNotFoundException: No Activity found to handle Intent {act = android.intent.action.CALL dat = Phone number: 1}"
. 错误消息是: "android.content.ActivityNotFoundException: No Activity found to handle Intent {act = android.intent.action.CALL dat = Phone number: 1}"
。 And that class is called by the MainStudent class, inserted in this code: https://ideone.com/b4jyU6 , 该类由MainStudent类调用,并插入以下代码中: https : //ideone.com/b4jyU6 ,
public void call(View view){
Intent it = new Intent(this, StudentCall.class);
it.putExtra("students", students);
startActivity(it);
}
the function that calls the previous class, is called "call", at line 31. Could you please helpe me? 在第31行中,调用上一类的函数称为“调用”。您能帮我吗?
Uri uri = Uri.parse("Phone number:" + student.phone_number);
This is not a valid Uri
. 这不是有效的Uri
。 Phone number:
is not a valid scheme, and 1
is unlikely to be a valid phone number. Phone number:
不是有效的方案,并且1
不太可能是有效的电话号码。
Use the tel:
scheme and an actual phone number. 使用tel:
方案和实际电话号码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.