缩放和平移时在 Google 地图上出现强制关闭错误

发布于 2024-11-27 01:06:46 字数 4366 浏览 1 评论 0原文

您好,在缩放和平移谷歌地图时出现以下错误。请告诉我可能的原因是什么,

                      07-30 19:50:02.003: ERROR/AndroidRuntime(3259):java.lang.OutOfMemoryError: bitmap size exceeds VM budget
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:401)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:414)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.android.maps.StreetViewRenderer.getOverlay(StreetViewRenderer.java:149)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.android.maps.StreetViewRenderer.renderTile(StreetViewRenderer.java:86)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.android.maps.AndroidTileOverlayRenderer.renderTile(AndroidTileOverlayRenderer.java:62)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.googlenav.map.Map.drawTile(Unknown Source)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.googlenav.map.Map.drawMapBackground(Unknown Source)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.googlenav.map.Map.drawMap(Unknown Source)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.android.maps.MapView.drawMap(MapView.java:1048)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.android.maps.MapView.onDraw(MapView.java:486)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.View.draw(View.java:6739)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.drawChild(ViewGroup.java:1648)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.View.draw(View.java:6742)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.drawChild(ViewGroup.java:1648)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.View.draw(View.java:6742)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1872)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewRoot.draw(ViewRoot.java:1422)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1167)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.os.Looper.loop(Looper.java:144)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.app.ActivityThread.main(ActivityThread.java:4937)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at java.lang.reflect.Method.invokeNative(Native Method)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at java.lang.reflect.Method.invoke(Method.java:521)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at dalvik.system.NativeStart.main(Native Method)

我尝试了通过覆盖逐项覆盖中的 ondraw 方法来解释堆栈溢出的所有可能解决方案。然而问题还是来了。请告知是否有人知道解决方案 谢谢 阿斯塔

Hi getting the following error while zooming and panning google maps. Kindly tell what could be the possible reason

                      07-30 19:50:02.003: ERROR/AndroidRuntime(3259):java.lang.OutOfMemoryError: bitmap size exceeds VM budget
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:401)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:414)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.android.maps.StreetViewRenderer.getOverlay(StreetViewRenderer.java:149)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.android.maps.StreetViewRenderer.renderTile(StreetViewRenderer.java:86)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.android.maps.AndroidTileOverlayRenderer.renderTile(AndroidTileOverlayRenderer.java:62)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.googlenav.map.Map.drawTile(Unknown Source)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.googlenav.map.Map.drawMapBackground(Unknown Source)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.googlenav.map.Map.drawMap(Unknown Source)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.android.maps.MapView.drawMap(MapView.java:1048)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.google.android.maps.MapView.onDraw(MapView.java:486)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.View.draw(View.java:6739)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.drawChild(ViewGroup.java:1648)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.View.draw(View.java:6742)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.drawChild(ViewGroup.java:1648)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.View.draw(View.java:6742)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1872)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewRoot.draw(ViewRoot.java:1422)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1167)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.os.Looper.loop(Looper.java:144)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at android.app.ActivityThread.main(ActivityThread.java:4937)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at java.lang.reflect.Method.invokeNative(Native Method)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at java.lang.reflect.Method.invoke(Method.java:521)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-30 19:50:02.003: ERROR/AndroidRuntime(3259):     at dalvik.system.NativeStart.main(Native Method)

I tried all the possile solutionn explained on stack overflow by overriding ondraw method in itemised overlay. Still the problem is coming. Please tell if anybody knows the solution
Thanks
Astha

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

明月松间行 2024-12-04 01:06:46

如果没有任何代码,将很难帮助你找出你做错了什么。

根据异常本身,您似乎存在内存泄漏。您可以阅读有关内存泄漏的一些信息
http://android-developers.blogspot.co.uk /2009/01/avoiding-memory-leaks.html

Without any code it will be hard to help you find out what you did wrong.

Based on the Exception itself, it seems like you have a memory leak. You can read some information about memory leaks on
http://android-developers.blogspot.co.uk/2009/01/avoiding-memory-leaks.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文