android.content.ActivityNotFoundException:无法找到显式活动类 {com.android.chrome/com.android.browser.BrowserActivity};您是否在 AndroidManifest.xml 中声明了此活动,或者您的意图与其声明的不匹配?图片
com.android.chrome/com.android.browser.BrowserActivity
您似乎正在尝试打开 chrome 应用程序的活动,而图像中显示的解决方案对此不起作用。
您可以尝试仅通过包打开它,例如:
String url = "http://www.yourlink.com";
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.setPackage("com.android.chrome");
try {
startActivity(i);
} catch (ActivityNotFoundException e) {
// Chrome is probably not installed
// Try with the default browser
i.setPackage(null);
startActivity(i);
}