1
我已經經歷了這麼多與此錯誤相關的帖子,但沒有得到適當的解決方案,我的問題。 在我的項目中有三個活動..每個活動有4個動畫我正在使用序列。 onclick改變我的活動我越來越虛擬機預算內存錯誤。 如何在我們正在進行其他活動的同時清除活力的記憶?從而使內存可用於下一個活動..提前幫助 感謝...位圖大小超過虛擬機預算...如何解決這個錯誤?
錯誤發生的歷史是如下....
09-10 10:35:12.046: ERROR/AndroidRuntime(472): FATAL EXCEPTION: main
09-10 10:35:12.046: ERROR/AndroidRuntime(472): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.graphics.Bitmap.nativeCreate(Native Method)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.graphics.Bitmap.createBitmap(Bitmap.java:468)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.graphics.Bitmap.createBitmap(Bitmap.java:435)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.content.res.Resources.loadDrawable(Resources.java:1709)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.content.res.Resources.getDrawable(Resources.java:581)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.graphics.drawable.AnimationDrawable.inflate(AnimationDrawable.java:265)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.content.res.Resources.loadDrawable(Resources.java:1694)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.content.res.Resources.getDrawable(Resources.java:581)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.view.View.setBackgroundResource(View.java:7393)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at com.bokstverna.InnerActivityR.onCreate(InnerActivityR.java:87)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.os.Handler.dispatchMessage(Handler.java:99)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.os.Looper.loop(Looper.java:123)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at android.app.ActivityThread.main(ActivityThread.java:4627)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at java.lang.reflect.Method.invokeNative(Native Method)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at java.lang.reflect.Method.invoke(Method.java:521)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-10 10:35:12.046: ERROR/AndroidRuntime(472): at dalvik.system.NativeStart.main(Native Method)
這將解決問題烏爾: http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue/823966#823966 –