大佬教程收集整理的这篇文章主要介绍了Android PlacePicker在发布后关闭2秒,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
重申一些事实:到目前为止,我的应用程序有两项活动.第一个活动是地图,到目前为止工作正常;没问题.第二个活动有一个按钮,允许用户启动PlacePicker.第一个活动启动地图没有任何问题的事实应该强化读者我的清单是好的,并且我的Google Api控制台具有正确的数据.所以这让我失望:我做错了什么?我使用的确切示例为https://developers.google.com/places/android-api/placepicker.实际上这是我的代码
try { IntentBuilder builder = new IntentBuilder(); startActivityForResult(builder.build(this),requEST_PLACE_PICKER); } catch (GooglePlayservicesRepairableException E) { e.printStackTrace(); } catch (GooglePlayservicesnotAvailableException E) { e.printStackTrace(); }
然后
@Override public void onActivityResult(int requestCode,int resultCode,Intent data) { super.onActivityResult(requestCode,resultCode,data); if (RESULT_OK != resultCodE) { Log.d(tag,"bad result: "+resultCodE); return; } if (requEST_PLACE_PICKER == requestCodE) { Place place = PlacePicker.getPlace(data,this); String toastmsg = String.format("Place: %s",place.getName()); Toast.makeText(this,toastmsg,Toast.LENGTH_LONG).show(); } }
这是我的完整日志
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN W/IInputConnectionWrapper: showStatusIcon on inactive InputConnection D/SRIB_DCS: log_dcs ThreadedRenderer::initialize entered! D/AddLOCATIOnActivity: bad result: 2
如何获得SHA-1指纹:
https://developers.google.com/places/android-api/signup#debug-cert
理想情况下,您可以将调试密钥SHA-1和释放密钥SHA-1添加到控制台,以便两个密钥都能够使用api.
您应该完成本页描述的步骤,并确保不要跳过任何内容:
https://developers.google.com/places/android-api/signup#api-console
以上是大佬教程为你收集整理的Android PlacePicker在发布后关闭2秒全部内容,希望文章能够帮你解决Android PlacePicker在发布后关闭2秒所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。