简体   繁体   English

android.content.ActivityNotFoundException:将url传递给intent

[英]android.content.ActivityNotFoundException: passing url to the intent

I have the following error in my app: 我的应用中出现以下错误:

Fatal Exception: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http://m.fretebras.com.br/fretes }
   at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632)
   at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424)
   at android.app.Activity.startActivityForResult(Activity.java:3468)
   at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:48)
   at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:75)
   at android.app.Activity.startActivityForResult(Activity.java:3429)
   at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:856)
   at android.app.Activity.startActivity(Activity.java:3671)
   at android.app.Activity.startActivity(Activity.java:3639)
   at br.lgfelicio.atividades.Checkin.acaoBotao(Checkin.java:773)
   at br.lgfelicio.atividades.Checkin$12.onClick(Checkin.java:312)
   at android.view.View.performClick(View.java:4461)
   at android.view.View$PerformClick.run(View.java:18543)
   at android.os.Handler.handleCallback(Handler.java:733)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:136)
   at android.app.ActivityThread.main(ActivityThread.java:5118)
   at java.lang.reflect.Method.invokeNative(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:515)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
   at dalvik.system.NativeStart.main(NativeStart.java)

Code with error: 代码有错误:

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://m.fretebras.com.br/fretes"));
startActivity(i);

The error occurs in versions 6.0.1 android, I have no idea why it's happening, I believe that by passing the url to Intent is all right. 错误发生在6.0.1版本的 android中,我不知道为什么会发生这种情况,我相信通过将url传递给Intent是可以的。 Can someone help me? 有人能帮我吗?

Seems like no browser installed on your phone. 好像手机上没有安装浏览器。 Please verify and to avoid crash use below code. 请验证并避免在代码下面使用崩溃。

try {
        Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://m.fretebras.com.br/fretes"));
        startActivity(i);
    } catch (ActivityNotFoundException e) {
        e.printStackTrace();
    }

Note - This code will just ignore your crash, if no browser found. 注意 - 如果没有找到浏览器,此代码将忽略您的崩溃。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android错误:“ android.content.ActivityNotFoundException:未找到用于处理Intent的活动” - Android error : “android.content.ActivityNotFoundException: No Activity found to handle Intent” android.content.ActivityNotFoundException:未找到用于处理Intent的活动 - android.content.ActivityNotFoundException: No Activity found to handle Intent 致命异常:android.content.ActivityNotFoundException:未找到处理 Intent 的活动 - Fatal Exception: android.content.ActivityNotFoundException: No Activity found to handle Intent 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 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{ } android.content.ActivityNotFoundException,无法开始活动 - android.content.ActivityNotFoundException ,unable to start activity android.content.ActivityNotFoundException: 没有找到处理意图的活动 { act=activity2.application1 (有额外的) } - android.content.ActivityNotFoundException: No Activity found to handle Intent { act=activity2.application1 (has extras) } android.content.ActivityNotFoundException:未找到任何处理Intent的活动{act = login_filter(有其他功能)} - android.content.ActivityNotFoundException: No Activity found to handle Intent { act=login_filter (has extras) } android.content.ActivityNotFoundException:无法在Android中找到明确的活动类 - android.content.ActivityNotFoundException: Unable to find explicit activity class in Android android.content.ActivityNotFoundException:无法找到明确的活动类 - android.content.ActivityNotFoundException: Unable to find explicit activity class
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM