来个牛人帮忙看看,直接上日志了
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.innoweaver.easylife/com.innoweaver.easylife.view.ShuangSecondActivity}:
android.view.InflateException: Binary XML file line #64: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2306)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
at android.app.ActivityThread.access$600(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1340)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5320)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #64: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:613)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
at android.app.Activity.setContentView(Activity.java:1881)
at com.innoweaver.easylife.view.ShuangSecondActivity.onCreate(ShuangSecondActivity.java:43)
at android.app.Activity.performCreate(Activity.java:5122)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
... 25 more
Caused by: java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:521)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:374)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
at android.content.res.Resources.loadDrawable(Resources.java:2015)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:3337)
at android.view.ViewGroup.<init>(ViewGroup.java:436)
at android.widget.LinearLayout.<init>(LinearLayout.java:176)
at android.widget.LinearLayout.<init>(LinearLayout.java:172)
... 28 more android --------------------编程问答-------------------- 内存溢出,应该是图片太大了。在你的XML配置文件引用的。 --------------------编程问答-------------------- 应该是你要用的哪个应用程序不能用吧,看下是不是导入的包有问题 --------------------编程问答-------------------- 内存溢出了,看是不是xml里面引用了尺寸很大的图 --------------------编程问答-------------------- 很明显 是 out of memomry异常啊 OOM伤不起啊 做Android的 --------------------编程问答-------------------- Caused by: java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:521)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:374)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
说明你decoede image资源的时候出现的异常 是不是自定义的View 建议楼主优化内存 --------------------编程问答-------------------- ShuangSecondActivity 这个自定义控件在xml中的路径不对吧 --------------------编程问答-------------------- 一看就是运行时错误,原因可能是内存不足,如果是模拟器,先把内存搞大的再试试。 --------------------编程问答-------------------- Caused by: java.lang.OutOfMemoryError 内存溢出
Caused by: android.view.InflateException: Binary XML file line #64: Error inflating class <unknown>
错误的原因可能是xml的第64行,先删除掉,排除下 看是否这个错误 针对这个错误再找办法。
补充:移动开发 , Android