检查我的应用程序的这个模型:
问题 :
如果我从第一页点击第二页按钮,它会打开第二页的新意图
然后
我从第二页单击第三页按钮,然后转到第三页
然后
我再次使用第一页按钮进入第一页,然后通过给出以下错误“内存不足... ”使应用程序崩溃
错误 :
05-13 11:35:06.417: D/dalvikvm(11948): GC_BEFORE_OOM freed 9K, 19% free 39660K/48583K, paused 36ms, total 36ms
05-13 11:35:06.417: E/dalvikvm-heap(11948): Out of memory on a 8684816-byte allocation.
05-13 11:35:06.425: I/dalvikvm(11948): "main" prio=5 tid=1 RUNNABLE
05-13 11:35:06.425: I/dalvikvm(11948): | group="main" sCount=0 dsCount=0 obj=0x40f01508 self=0x40d41a18
05-13 11:35:06.425: I/dalvikvm(11948): | sysTid=11948 nice=0 sched=0/0 cgrp=apps handle=1074921264
05-13 11:35:06.425: I/dalvikvm(11948): | schedstat=( 5318603531 1290588360 5684 ) utm=446 stm=85 core=0
05-13 11:35:06.425: I/dalvikvm(11948): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
05-13 11:35:06.425: I/dalvikvm(11948): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:592)
05-13 11:35:06.425: I/dalvikvm(11948): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:445)
05-13 11:35:06.425: I/dalvikvm(11948): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:781)
05-13 11:35:06.425: I/dalvikvm(11948): at android.content.res.Resources.loadDrawable(Resources.java:1963)
05-13 11:35:06.425: I/dalvikvm(11948): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
05-13 11:35:06.425: I/dalvikvm(11948): at android.view.View.<init>(View.java:3443)
05-13 11:35:06.425: I/dalvikvm(11948): at android.view.View.<init>(View.java:3376)
05-13 11:35:06.425: I/dalvikvm(11948): at android.view.ViewGroup.<init>(ViewGroup.java:426)
05-13 11:35:06.425: I/dalvikvm(11948): at android.widget.RelativeLayout.<init>(RelativeLayout.java:184)
05-13 11:35:06.425: I/dalvikvm(11948): at java.lang.reflect.Constructor.constructNative(Native Method)
05-13 11:35:06.425: I/dalvikvm(11948): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
05-13 11:35:06.433: I/dalvikvm(11948): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
05-13 11:35:06.433: I/dalvikvm(11948): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
05-13 11:35:06.433: I/dalvikvm(11948): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
05-13 11:35:06.433: I/dalvikvm(11948): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
05-13 11:35:06.433: I/dalvikvm(11948): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
05-13 11:35:06.433: I/dalvikvm(11948): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
05-13 11:35:06.433: I/dalvikvm(11948): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
05-13 11:35:06.433: I/dalvikvm(11948): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
05-13 11:35:06.433: I/dalvikvm(11948): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
05-13 11:35:06.433: I/dalvikvm(11948): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
05-13 11:35:06.433: I/dalvikvm(11948): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:306)
05-13 11:35:06.433: I/dalvikvm(11948): at android.app.Activity.setContentView(Activity.java:1912)
05-13 11:35:06.440: I/dalvikvm(11948): at com.mca.LastingPowerActivity.onCreate(LastingPowerActivity.java:24)
05-13 11:35:06.440: I/dalvikvm(11948): at android.app.Activity.performCreate(Activity.java:5163)
05-13 11:35:06.440: I/dalvikvm(11948): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
05-13 11:35:06.440: I/dalvikvm(11948): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
05-13 11:35:06.440: I/dalvikvm(11948): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
05-13 11:35:06.440: I/dalvikvm(11948): at android.app.ActivityThread.access$600(ActivityThread.java:140)
05-13 11:35:06.440: I/dalvikvm(11948): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
05-13 11:35:06.440: I/dalvikvm(11948): at android.os.Handler.dispatchMessage(Handler.java:99)
05-13 11:35:06.440: I/dalvikvm(11948): at android.os.Looper.loop(Looper.java:137)
05-13 11:35:06.440: I/dalvikvm(11948): at android.app.ActivityThread.main(ActivityThread.java:4895)
05-13 11:35:06.440: I/dalvikvm(11948): at java.lang.reflect.Method.invokeNative(Native Method)
05-13 11:35:06.440: I/dalvikvm(11948): at java.lang.reflect.Method.invoke(Method.java:511)
05-13 11:35:06.440: I/dalvikvm(11948): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
05-13 11:35:06.440: I/dalvikvm(11948): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
05-13 11:35:06.440: I/dalvikvm(11948): at dalvik.system.NativeStart.main(Native Method)
05-13 11:35:06.440: D/skia(11948): --- decoder->decode returned false
05-13 11:35:06.440: D/AndroidRuntime(11948): Shutting down VM
05-13 11:35:06.440: W/dalvikvm(11948): threadid=1: thread exiting with uncaught exception (group=0x40f002a0)
05-13 11:35:06.456: E/AndroidRuntime(11948): FATAL EXCEPTION: main
05-13 11:35:06.456: E/AndroidRuntime(11948): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mca/com.mca.LastingPowerActivity}: android.view.InflateException: Binary XML file line #18: Error inflating class <unknown>
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.app.ActivityThread.access$600(ActivityThread.java:140)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.os.Handler.dispatchMessage(Handler.java:99)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.os.Looper.loop(Looper.java:137)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.app.ActivityThread.main(ActivityThread.java:4895)
05-13 11:35:06.456: E/AndroidRuntime(11948): at java.lang.reflect.Method.invokeNative(Native Method)
05-13 11:35:06.456: E/AndroidRuntime(11948): at java.lang.reflect.Method.invoke(Method.java:511)
05-13 11:35:06.456: E/AndroidRuntime(11948): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
05-13 11:35:06.456: E/AndroidRuntime(11948): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
05-13 11:35:06.456: E/AndroidRuntime(11948): at dalvik.system.NativeStart.main(Native Method)
05-13 11:35:06.456: E/AndroidRuntime(11948): Caused by: android.view.InflateException: Binary XML file line #18: Error inflating class <unknown>
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
05-13 11:35:06.456: E/AndroidRuntime(11948): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
05-13 11:35:06.456: E/AndroidRuntime(11948): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:306)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.app.Activity.setContentView(Activity.java:1912)
05-13 11:35:06.456: E/AndroidRuntime(11948): at com.mca.LastingPowerActivity.onCreate(LastingPowerActivity.java:24)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.app.Activity.performCreate(Activity.java:5163)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
05-13 11:35:06.456: E/AndroidRuntime(11948): ... 11 more
05-13 11:35:06.456: E/AndroidRuntime(11948): Caused by: java.lang.reflect.InvocationTargetException
05-13 11:35:06.456: E/AndroidRuntime(11948): at java.lang.reflect.Constructor.constructNative(Native Method)
05-13 11:35:06.456: E/AndroidRuntime(11948): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
05-13 11:35:06.456: E/AndroidRuntime(11948): ... 26 more
05-13 11:35:06.456: E/AndroidRuntime(11948): Caused by: java.lang.OutOfMemoryError
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:592)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:445)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:781)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.content.res.Resources.loadDrawable(Resources.java:1963)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.View.<init>(View.java:3443)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.View.<init>(View.java:3376)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.view.ViewGroup.<init>(ViewGroup.java:426)
05-13 11:35:06.456: E/AndroidRuntime(11948): at android.widget.RelativeLayout.<init>(RelativeLayout.java:184)
05-13 11:35:06.456: E/AndroidRuntime(11948): ... 29 more
如果有人知道,请分享您的答案,以便我解决。
谢谢你。