这些错误似乎是偶然的,我无法重现它们。从堆栈中我可以了解到,我的不同布局资源可能会发生此类错误。
谁能解释为什么会发生此错误?我能做些什么来解决这个问题?
06-03 12:30:30.858: E/AndroidRuntime(1010): FATAL EXCEPTION: main
06-03 12:30:30.858: E/AndroidRuntime(1010): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.matineeapplicationlayer/com.example.matineeapplicationlayer.MatineeAPP}: android.view.InflateException: Binary XML file line #822: Error inflating class <unknown>
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1748)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1764)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.app.ActivityThread.access$1500(ActivityThread.java:122)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1002)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.os.Handler.dispatchMessage(Handler.java:99)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.os.Looper.loop(Looper.java:132)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.app.ActivityThread.main(ActivityThread.java:4025)
06-03 12:30:30.858: E/AndroidRuntime(1010): at java.lang.reflect.Method.invokeNative(Native Method)
06-03 12:30:30.858: E/AndroidRuntime(1010): at java.lang.reflect.Method.invoke(Method.java:491)
06-03 12:30:30.858: E/AndroidRuntime(1010): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
06-03 12:30:30.858: E/AndroidRuntime(1010): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
06-03 12:30:30.858: E/AndroidRuntime(1010): at dalvik.system.NativeStart.main(Native Method)
06-03 12:30:30.858: E/AndroidRuntime(1010): Caused by: android.view.InflateException: Binary XML file line #822: Error inflating class <unknown>
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.createView(LayoutInflater.java:596)
06-03 12:30:30.858: E/AndroidRuntime(1010): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:644)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.rInflate(LayoutInflater.java:724)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.inflate(LayoutInflater.java:347)
06-03 12:30:30.858: E/AndroidRuntime(1010): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:223)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.app.Activity.setContentView(Activity.java:1780)
06-03 12:30:30.858: E/AndroidRuntime(1010): at com.example.matineeapplicationlayer.MatineeAPP.onCreate(MatineeAPP.java:13)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1712)
06-03 12:30:30.858: E/AndroidRuntime(1010): ... 11 more
06-03 12:30:30.858: E/AndroidRuntime(1010): Caused by: java.lang.reflect.InvocationTargetException
06-03 12:30:30.858: E/AndroidRuntime(1010): at java.lang.reflect.Constructor.constructNative(Native Method)
06-03 12:30:30.858: E/AndroidRuntime(1010): at java.lang.reflect.Constructor.newInstance(Constructor.java:416)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.view.LayoutInflater.createView(LayoutInflater.java:576)
06-03 12:30:30.858: E/AndroidRuntime(1010): ... 30 more
06-03 12:30:30.858: E/AndroidRuntime(1010): Caused by: java.lang.OutOfMemoryError
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.graphics.Bitmap.nativeCreate(Native Method)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.graphics.Bitmap.createBitmap(Bitmap.java:604)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:738)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.content.res.Resources.loadDrawable(Resources.java:1869)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.widget.ImageView.<init>(ImageView.java:118)
06-03 12:30:30.858: E/AndroidRuntime(1010): at android.widget.ImageView.<init>(ImageView.java:108)
06-03 12:30:30.858: E/AndroidRuntime(1010): ... 33 more
package com.example.matineeapplicationlayer;
导入android.app.Activity;导入android.os.Bundle;
公共类 MatineeAPP 扩展 Activity {
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.matinee_app);
}
}