gpt4 book ai didi

调用市场 URL 时 android Intent.ACTION_VIEW 崩溃

转载 作者:搜寻专家 更新时间:2023-11-01 08:11:18 25 4
gpt4 key购买 nike

我想为我的应用程序创建一个反馈字段。我只想像这样将用户重定向到市场

String APP_MARKET_URL = "market://details?id=com.my.application"; 

Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse(APP_MARKET_URL));
this.startActivity(intent);

但是当我执行它时出现了这个错误:

02-13 11:07:33.147: W/dalvikvm(238): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
02-13 11:07:33.155: E/AndroidRuntime(238): Uncaught handler: thread main exiting due to uncaught exception
02-13 11:07:33.225: E/AndroidRuntime(238): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.picca.pointage.NoterApplication }
02-13 11:07:33.225: E/AndroidRuntime(238): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)
02-13 11:07:33.225: E/AndroidRuntime(238): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
02-13 11:07:33.225: E/AndroidRuntime(238): at android.app.Activity.startActivityForResult(Activity.java:2749)
02-13 11:07:33.225: E/AndroidRuntime(238): at android.app.Activity.startActivity(Activity.java:2855)
02-13 11:07:33.225: E/AndroidRuntime(238): at android.preference.Preference.performClick(Preference.java:829)
02-13 11:07:33.225: E/AndroidRuntime(238): at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:190)
02-13 11:07:33.225: E/AndroidRuntime(238): at android.widget.AdapterView.performItemClick(AdapterView.java:284)
02-13 11:07:33.225: E/AndroidRuntime(238): at android.widget.ListView.performItemClick(ListView.java:3285)
02-13 11:07:33.225: E/AndroidRuntime(238): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640)
02-13 11:07:33.225: E/AndroidRuntime(238): at android.os.Handler.handleCallback(Handler.java:587)
02-13 11:07:33.225: E/AndroidRuntime(238): at android.os.Handler.dispatchMessage(Handler.java:92)
02-13 11:07:33.225: E/AndroidRuntime(238): at android.os.Looper.loop(Looper.java:123)
02-13 11:07:33.225: E/AndroidRuntime(238): at android.app.ActivityThread.main(ActivityThread.java:4363)
02-13 11:07:33.225: E/AndroidRuntime(238): at java.lang.reflect.Method.invokeNative(Native Method)
02-13 11:07:33.225: E/AndroidRuntime(238): at java.lang.reflect.Method.invoke(Method.java:521)
02-13 11:07:33.225: E/AndroidRuntime(238): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-13 11:07:33.225: E/AndroidRuntime(238): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-13 11:07:33.225: E/AndroidRuntime(238): at dalvik.system.NativeStart.main(Native Method)

我使用的是安卓 1.5。我没有在 list 中放入具体条目。任何人有调用我的市场页面的想法或其他方法吗?

最佳答案

扩展之前的评论,您可以使用如下代码检查 Intent 是否可以在设备上解析,然后再使用它启动新的 Activity:

    PackageManager pm = context.getPackageManager();
ComponentName cn = intent.resolveActivity(pm);
if (cn != null) {
this.startActivity(intent);
}

关于调用市场 URL 时 android Intent.ACTION_VIEW 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9259535/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com