setContentView Android应用程序崩溃错误

时间:2013-08-04 05:46:18

标签: android view

我在执行set setContentView行时遇到此错误。

也许有人认出这个堆栈。问题是我将一个Activity设置为Main Launch并且evveerything正确,但如果我将另一个activiy设置为主Launch,那么当我到达这一行时应用程序崩溃。似乎android不想从我的新活动xD开始。

08-04 02:15:07.150: E/dalvikvm-heap(1271): Out of memory on a 4820416-byte allocation.
08-04 02:15:07.150: I/dalvikvm(1271): "main" prio=5 tid=1 RUNNABLE
08-04 02:15:07.150: I/dalvikvm(1271):   | group="main" sCount=0 dsCount=0 obj=0x41d48508 self=0x41d35ba0
08-04 02:15:07.150: I/dalvikvm(1271):   | sysTid=1271 nice=0 sched=0/0 cgrp=apps handle=1075486512
08-04 02:15:07.150: I/dalvikvm(1271):   | schedstat=( 4044141405 1900840195 12713 ) utm=296 stm=107 core=3
08-04 02:15:07.150: I/dalvikvm(1271):   at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
08-04 02:15:07.150: I/dalvikvm(1271):   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:623)
08-04 02:15:07.150: I/dalvikvm(1271):   at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:476)
08-04 02:15:07.155: I/dalvikvm(1271):   at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:781)
08-04 02:15:07.155: I/dalvikvm(1271):   at android.content.res.Resources.loadDrawable(Resources.java:1963)
08-04 02:15:07.155: I/dalvikvm(1271):   at android.content.res.Resources.getDrawable(Resources.java:672)
08-04 02:15:07.155: I/dalvikvm(1271):   at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
08-04 02:15:07.155: I/dalvikvm(1271):   at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:881)
08-04 02:15:07.155: I/dalvikvm(1271):   at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818)
08-04 02:15:07.155: I/dalvikvm(1271):   at android.content.res.Resources.loadDrawable(Resources.java:1948)
08-04 02:15:07.155: I/dalvikvm(1271):   at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
08-04 02:15:07.155: I/dalvikvm(1271):   at android.view.View.<init>(View.java:3436)
08-04 02:15:07.155: I/dalvikvm(1271):   at android.widget.TextView.<init>(TextView.java:571)
08-04 02:15:07.155: I/dalvikvm(1271):   at android.widget.Button.<init>(Button.java:107)
08-04 02:15:07.155: I/dalvikvm(1271):   at android.widget.Button.<init>(Button.java:103)
08-04 02:15:07.155: I/dalvikvm(1271):   at java.lang.reflect.Constructor.constructNative(Native Method)
08-04 02:15:07.155: I/dalvikvm(1271):   at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.view.LayoutInflater.createView(LayoutInflater.java:587)
08-04 02:15:07.160: I/dalvikvm(1271):   at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
08-04 02:15:07.160: I/dalvikvm(1271):   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:308)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.app.Activity.setContentView(Activity.java:1924)
08-04 02:15:07.160: I/dalvikvm(1271):   at com.example.listviewapp.mattress_home.NewColchonActivity.onCreate(NewColchonActivity.java:33)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.app.Activity.performCreate(Activity.java:5206)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.app.ActivityThread.access$600(ActivityThread.java:140)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.os.Handler.dispatchMessage(Handler.java:99)
08-04 02:15:07.160: I/dalvikvm(1271):   at android.os.Looper.loop(Looper.java:137)
08-04 02:15:07.165: I/dalvikvm(1271):   at android.app.ActivityThread.main(ActivityThread.java:4898)
08-04 02:15:07.165: I/dalvikvm(1271):   at java.lang.reflect.Method.invokeNative(Native Method)
08-04 02:15:07.165: I/dalvikvm(1271):   at java.lang.reflect.Method.invoke(Method.java:511)
08-04 02:15:07.165: I/dalvikvm(1271):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
08-04 02:15:07.165: I/dalvikvm(1271):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
08-04 02:15:07.165: I/dalvikvm(1271):   at dalvik.system.NativeStart.main(Native Method)

请求帮助!

0 个答案:

没有答案