git-xuhao / KotlinMvp

:fire: 基于Kotlin+MVP+Retrofit+RxJava+Glide 等架构实现短视频类小项目,简约风格及详细注释,欢迎 star or fork!
https://xuhaoblog.com/KotlinMvp
Apache License 2.0
3.69k stars 917 forks source link

android.content.ActivityNotFoundException: No Activity found to handle Intent #38

Open europa opened 5 years ago

europa commented 5 years ago

05-13 15:24:52.696 5714-5714/com.hazz.kotlinmvp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.hazz.kotlinmvp, PID: 5714 android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://github.com/git-xuhao/KotlinMvp } at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1781) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1501) at android.app.Activity.startActivityForResult(Activity.java:3788) at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:68) at android.app.Activity.startActivityForResult(Activity.java:3749) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:751) at android.app.Activity.startActivity(Activity.java:4059) at android.app.Activity.startActivity(Activity.java:4027) at com.hazz.kotlinmvp.ui.activity.AboutActivity$initView$2.onClick(AboutActivity.kt:36) at android.view.View.performClick(View.java:4781) at android.view.View$PerformClick.run(View.java:19874) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)

I accounter this bug in some pos machines . Maybe you can avoid the problem with the code below in AboutActivity. val uri = Uri.parse("https://github.com/git-xuhao/KotlinMvp") val intent = Intent(Intent.ACTION_VIEW, uri) startActivity(intent)