下载 Google 播放服务
Download Google Play Services
在我的 android 应用程序中,我使用 google 播放服务来查看 google 地图
如果设备现在安装了 google 播放服务,android 会显示一个按钮 "Get Google Play Services"
这个按钮来自 android 本身,我没有创建它。
问题是每当用户单击该按钮时,应用程序就会崩溃。
我尝试跟踪代码并进行调试,但没有相关代码(我没有为此创建任何代码)
我收到此错误,不确定如何解决。
有什么想法吗?
谢谢
05-06 23:58:17.730 2695-2695/com.asmgx.schlogger.app D/AndroidRuntime﹕ Shutting down VM
05-06 23:58:17.730 2695-2695/com.asmgx.schlogger.app E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.asmgx.schlogger.app, PID: 2695
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.android.gms flg=0x80000 pkg=com.android.vending }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1781)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1501)
at android.app.Activity.startActivityForResult(Activity.java:3745)
at android.app.Activity.startActivityForResult(Activity.java:3706)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:817)
at android.app.Activity.startActivity(Activity.java:4016)
at android.app.Activity.startActivity(Activity.java:3984)
at com.google.android.gms.dynamic.zza.onClick(Unknown Source)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
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:5257)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
您收到此错误是因为您 运行 您的代码在没有 Google Play 商店的 Android 设备上。
您可以像这样检查您的意图是否会成功:
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
} else {
//There isn't an app that handle your intent
}
在我的 android 应用程序中,我使用 google 播放服务来查看 google 地图
如果设备现在安装了 google 播放服务,android 会显示一个按钮 "Get Google Play Services" 这个按钮来自 android 本身,我没有创建它。
问题是每当用户单击该按钮时,应用程序就会崩溃。
我尝试跟踪代码并进行调试,但没有相关代码(我没有为此创建任何代码)
我收到此错误,不确定如何解决。
有什么想法吗?
谢谢
05-06 23:58:17.730 2695-2695/com.asmgx.schlogger.app D/AndroidRuntime﹕ Shutting down VM
05-06 23:58:17.730 2695-2695/com.asmgx.schlogger.app E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.asmgx.schlogger.app, PID: 2695
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.android.gms flg=0x80000 pkg=com.android.vending }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1781)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1501)
at android.app.Activity.startActivityForResult(Activity.java:3745)
at android.app.Activity.startActivityForResult(Activity.java:3706)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:817)
at android.app.Activity.startActivity(Activity.java:4016)
at android.app.Activity.startActivity(Activity.java:3984)
at com.google.android.gms.dynamic.zza.onClick(Unknown Source)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
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:5257)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
您收到此错误是因为您 运行 您的代码在没有 Google Play 商店的 Android 设备上。
您可以像这样检查您的意图是否会成功:
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
} else {
//There isn't an app that handle your intent
}