how to resolve this exception?

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

how to resolve this exception?

Postby zpk1234 » Sat Aug 15, 2009 4:33 am

when i click the zoom in button on the mapView quickly, it will cause a exception frequently, the exception is:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. 08-15 03:19:19.584: ERROR/AndroidRuntime(1157): Uncaught handler: thread main exiting due to uncaught exception
  3.  
  4. 08-15 03:19:19.645: ERROR/AndroidRuntime
  5.  
  6.  
  7.  
  8. (1157): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
  9.  
  10. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at android.graphics.Bitmap.nativeCreate
  11.  
  12.  
  13.  
  14. (Native Method)
  15.  
  16. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at android.graphics.Bitmap.createBitmap(Bitmap.java:483)
  17.  
  18. 08-15 03:19:19.645:
  19.  
  20.  
  21.  
  22. ERROR/AndroidRuntime(1157):     at com.google.android.maps.ZoomHelper.createSnapshot(ZoomHelper.java:305)
  23.  
  24. 08-15 03:19:19.645: ERROR/AndroidRuntime
  25.  
  26.  
  27.  
  28. (1157):     at com.google.android.maps.ZoomHelper.doZoom(ZoomHelper.java:137)
  29.  
  30. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  31.  
  32.  
  33.  
  34. com.google.android.maps.ZoomHelper.doZoom(ZoomHelper.java:126)
  35.  
  36. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  37.  
  38.  
  39.  
  40. com.google.android.maps.MapView.doZoom(MapView.java:1454)
  41.  
  42. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  43.  
  44.  
  45.  
  46. com.google.android.maps.MapView.doZoom(MapView.java:1463)
  47.  
  48. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  49.  
  50.  
  51.  
  52. com.google.android.maps.MapView$5.onZoom(MapView.java:1418)
  53.  
  54. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  55.  
  56.  
  57.  
  58. android.widget.ZoomButtonsController$3.onClick(ZoomButtonsController.java:269)
  59.  
  60. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  61.  
  62.  
  63.  
  64. android.view.View.performClick(View.java:2179)
  65.  
  66. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at android.view.View.onTouchEvent(View.java:3828)
  67.  
  68. 08-15
  69.  
  70.  
  71.  
  72. 03:19:19.645: ERROR/AndroidRuntime(1157):     at android.widget.ZoomButton.onTouchEvent(ZoomButton.java:62)
  73.  
  74. 08-15 03:19:19.645: ERROR/AndroidRuntime
  75.  
  76.  
  77.  
  78. (1157):     at android.view.View.dispatchTouchEvent(View.java:3368)
  79.  
  80. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  81.  
  82.  
  83.  
  84. android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
  85.  
  86. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  87.  
  88.  
  89.  
  90. android.widget.ZoomButtonsController.onTouch(ZoomButtonsController.java:582)
  91.  
  92. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  93.  
  94.  
  95.  
  96. android.view.View.dispatchTouchEvent(View.java:3364)
  97.  
  98. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at android.view.ViewGroup.dispatchTouchEvent
  99.  
  100.  
  101.  
  102. (ViewGroup.java:831)
  103.  
  104. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
  105.  
  106. 08-15 03:19:19.645:
  107.  
  108.  
  109.  
  110. ERROR/AndroidRuntime(1157):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
  111.  
  112. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  113.  
  114.  
  115.  
  116. android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
  117.  
  118. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  119.  
  120.  
  121.  
  122. android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
  123.  
  124. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  125.  
  126.  
  127.  
  128. android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
  129.  
  130. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  131.  
  132.  
  133.  
  134. com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1735)
  135.  
  136. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):    
  137.  
  138.  
  139.  
  140. at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1206)
  141.  
  142. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  143.  
  144.  
  145.  
  146. android.app.Activity.dispatchTouchEvent(Activity.java:1993)
  147.  
  148. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at com.android.gmap.GMap.dispatchTouchEvent
  149.  
  150.  
  151.  
  152. (GMap.java:234)
  153.  
  154. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent
  155.  
  156.  
  157.  
  158. (PhoneWindow.java:1719)
  159.  
  160. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1531)
  161.  
  162. 08-15 03:19:19.645:
  163.  
  164.  
  165.  
  166. ERROR/AndroidRuntime(1157):     at android.os.Handler.dispatchMessage(Handler.java:99)
  167.  
  168. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  169.  
  170.  
  171.  
  172. android.os.Looper.loop(Looper.java:123)
  173.  
  174. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at android.app.ActivityThread.main(ActivityThread.java:3948)
  175.  
  176. 08-15
  177.  
  178.  
  179.  
  180. 03:19:19.645: ERROR/AndroidRuntime(1157):     at java.lang.reflect.Method.invokeNative(Native Method)
  181.  
  182. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  183.  
  184.  
  185.  
  186. java.lang.reflect.Method.invoke(Method.java:521)
  187.  
  188. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  189.  
  190.  
  191.  
  192. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
  193.  
  194. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at
  195.  
  196.  
  197.  
  198. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
  199.  
  200. 08-15 03:19:19.645: ERROR/AndroidRuntime(1157):     at dalvik.system.NativeStart.main(Native Method)
  201.  
  202.  
Parsed in 0.047 seconds, using GeSHi 1.0.8.4


how can i resolve this? thanks
zpk1234
Junior Developer
Junior Developer
 
Posts: 22
Joined: Sat Jun 27, 2009 1:17 pm

Top

Postby padde » Sat Aug 15, 2009 1:01 pm

use smaler pictures....
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby zpk1234 » Tue Aug 18, 2009 4:27 am

Anny comments? Am I missing something?
zpk1234
Junior Developer
Junior Developer
 
Posts: 22
Joined: Sat Jun 27, 2009 1:17 pm

Postby padde » Tue Aug 18, 2009 9:09 am

Well my response was related to this line

(1157): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
08-15 03:19:19.645: ERROR/AndroidRuntime(1157): at android.graphics.Bitmap.nativeCreate

Apparently you try to create a to huge bitmap.. maybe you should try to create a few smaler ones
instead.
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby zpk1234 » Tue Aug 18, 2009 2:37 pm

but the bitmap is created by Mapview, i can do anything for bitmap created
zpk1234
Junior Developer
Junior Developer
 
Posts: 22
Joined: Sat Jun 27, 2009 1:17 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 6 guests