您在缩放和平移谷歌地图时收到以下错误。请告诉可能的原因
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方法尝试了所有可能的解决方案,解决了堆栈溢出问题。问题仍然存在。请告诉我们是否有人知道解决方案 谢谢 Astha
答案 0 :(得分:1)
没有任何代码,很难帮助你找出你做错了什么。
基于Exception本身,您似乎有内存泄漏。您可以阅读有关内存泄漏的一些信息 http://android-developers.blogspot.co.uk/2009/01/avoiding-memory-leaks.html