【发布时间】:2018-12-10 14:08:44
【问题描述】:
我已经在我的一个应用程序中实现了谷歌地图,当我选择任何位置而不是伦敦时,一切都运行良好,但是当我尝试选择伦敦的任何位置并尝试放大和缩小而不是应用程序时会崩溃的。
请帮助我。我只想用谷歌地图来做,只是我不想使用任何第三方地图。
DisplayMetrics displayMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels;
int width = displayMetrics.widthPixels;
LatLngBounds bounds = new LatLngBounds(new LatLng(lat, lng), new LatLng(lat, lng));
googleMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, width, height, 20));
Logcat:
07-02 05:20:35.409 32739-665/com.example E/AndroidRuntime: 致命 例外:GLThread 19450 进程:com.example,PID:32739 java.lang.StackOverflowError:堆栈大小 1037KB 在 com.google.maps.api.android.lib6.common.i.(:com.google.android.gms.dynamite_dynamitemodulesb@12685025@12.6.85 (040408-197041431):9)
【问题讨论】:
-
whatsApp 在伦敦也崩溃了...
-
崩溃是怎么回事?检查 logcat 并发布 stacktrace。
-
我在伦敦的 Uber 应用程序中也遇到了崩溃。
-
嗨 @ADM 请检查 Logcat。我已按您的要求添加了。
标签: android google-maps dictionary google-maps-android-api-2