简体   繁体   English

找不到用于处理Intent {的活动“ act = android.intent.action.CALL dat =电话号码:1}?

[英]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. 我已经更改了manifestActivity和主类,并输入了必要的权限,但是它不起作用。 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.

相关问题 找不到处理 Intent { act=android.intent.action.CALL dat=tel0710000001 } 的活动 - No Activity found to handle Intent { act=android.intent.action.CALL dat=tel0710000001 } android.content.ActivityNotFoundException:没有找到处理意图的活动{act=android.intent.action.VIEW dat=PendingIntent{} - android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=PendingIntent{ } 找不到用于处理意图的活动{act = android.intent.action.View} - No activity found to handle intent { act=android.intent.action.View } 没有找到处理意图的活动{act=android,intent.action.VIEW} - No activity found to handle intent{act=android,intent.action.VIEW} ActivityNotFoundException:未找到处理 Intent { act= dat="url" 的活动 - ActivityNotFoundException: No Activity found to handle Intent { act= dat="url" android.content.ActivityNotFoundException:未找到任何处理Intent的活动{act = android.intent.action.GET_CONTENT - android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.GET_CONTENT 未找到处理 Intent 的活动 (act=android.intent.action.VIEW) 正在尝试安装 APK - No Activity Found to handle Intent (act=android.intent.action.VIEW) Trying to Install APK 找不到用于处理意图的活动{act = android.intent.action.OPEN_DOCUMENT cat = [android.intent.category.OPENABLE] typ = / *} - No Activity found to handle Intent { act=android.intent.action.OPEN_DOCUMENT cat=[android.intent.category.OPENABLE] typ=/* } 找不到活动来处理Intent {act = android.settings.action.MANAGE_WRITE_SETTINGS - No Activity found to handle Intent { act=android.settings.action.MANAGE_WRITE_SETTINGS 错误找不到活动来处理Intent act = android.media.action.IMAGE_CAPTURE - Error No Activity found to handle Intent act=android.media.action.IMAGE_CAPTURE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM