如果我使用特定的背景图像,Android应用程序强制在启动画面后关闭

时间:2012-08-01 20:07:38

标签: android android-manifest splash-screen

这让我很困惑。如果我将android:background设置为我专门为splashActivity设计的PNG,应用程序会在显示图像三秒后关闭。

如果我使用在mainActivity上使用的相同的android:背景图像,该应用程序运行正常。如果我不在xml中包含背景,它也可以正常运行。

唯一的区别是我正在使用不同的背景图像。我正在使用的启动图像绝对位于drawable-hdpi中,它在R.java中被明确引用。

有什么想法吗?

Logocat,只有在我使用我想要使用的启动图像时才会显示:

08-01 16:09:39.557: D/AndroidRuntime(15794): Shutting down VM
08-01 16:09:39.557: W/dalvikvm(15794): threadid=1: thread exiting with uncaught exception (group=0x40a471f8)
08-01 16:09:39.572: E/AndroidRuntime(15794): FATAL EXCEPTION: main
08-01 16:09:39.572: E/AndroidRuntime(15794): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.moboing.abcblast/com.moboing.abcblast.Main}: android.view.InflateException: Binary XML file line #826: Error inflating class <unknown>
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.app.ActivityThread.access$600(ActivityThread.java:123)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.os.Handler.dispatchMessage(Handler.java:99)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.os.Looper.loop(Looper.java:137)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.app.ActivityThread.main(ActivityThread.java:4424)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at java.lang.reflect.Method.invokeNative(Native Method)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at java.lang.reflect.Method.invoke(Method.java:511)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at dalvik.system.NativeStart.main(Native Method)
08-01 16:09:39.572: E/AndroidRuntime(15794): Caused by: android.view.InflateException: Binary XML file line #826: Error inflating class <unknown>
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.view.LayoutInflater.createView(LayoutInflater.java:606)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.app.Activity.setContentView(Activity.java:1835)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at com.moboing.abcblast.Main.onCreate(Main.java:28)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.app.Activity.performCreate(Activity.java:4465)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
08-01 16:09:39.572: E/AndroidRuntime(15794):    ... 11 more
08-01 16:09:39.572: E/AndroidRuntime(15794): Caused by: java.lang.reflect.InvocationTargetException
08-01 16:09:39.572: E/AndroidRuntime(15794):    at java.lang.reflect.Constructor.constructNative(Native Method)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.view.LayoutInflater.createView(LayoutInflater.java:586)
08-01 16:09:39.572: E/AndroidRuntime(15794):    ... 24 more
08-01 16:09:39.572: E/AndroidRuntime(15794): Caused by: java.lang.OutOfMemoryError
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.graphics.Bitmap.nativeCreate(Native Method)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.content.res.Resources.loadDrawable(Resources.java:1935)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.widget.ImageView.<init>(ImageView.java:119)
08-01 16:09:39.572: E/AndroidRuntime(15794):    at android.widget.ImageView.<init>(ImageView.java:109)
08-01 16:09:39.572: E/AndroidRuntime(15794):    ... 27 more

0 个答案:

没有答案