Error inflating android.widget.ImageView in android 2.0
This is the stack trace for Imageview. Similar error is generated for icon Resource not found. This happened when i was trying to execute app in android 2.0 but it runs fine for versions > 2.0. I dont know what is the problem. Also, my xml is a splashscreen image. Thats it. Can somebody please help me with this? Thanks!!
W/dalvikvm( 233): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
E/AndroidRuntime( 233): Uncaught handler: thread main exiting due to uncaught exception
**E/AndroidRuntime( 233): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.medical.ReadingHealth/com.medical.ReadingHea
lth.SplashScreen}: android.view.InflateException: Binary XML file line #7: Error inflating class** android.widget.ImageView
E/AndroidRuntime( 233): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2454)
E/AndroidRuntime( 233): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)
E/AndroidRuntime( 233): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
E/AndroidRuntime( 233): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
E/AndroidRuntime( 233): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 233): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 233): at android.app.ActivityThread.main(ActivityThread.java:4310)
E/AndroidRuntime( 233): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 233): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 233): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 233): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime( 233): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 233): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class an开发者_如何学编程droid.widget.ImageView
E/AndroidRuntime( 233): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
E/AndroidRuntime( 233): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
E/AndroidRuntime( 233): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
E/AndroidRuntime( 233): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
E/AndroidRuntime( 233): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
E/AndroidRuntime( 233): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
E/AndroidRuntime( 233): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
E/AndroidRuntime( 233): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
E/AndroidRuntime( 233): at android.app.Activity.setContentView(Activity.java:1622)
E/AndroidRuntime( 233): at com.medical.ReadingHealth.SplashScreen.onCreate(SplashScreen.java:14)
E/AndroidRuntime( 233): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 233): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
E/AndroidRuntime( 233): ... 11 more
E/AndroidRuntime( 233): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 233): at android.widget.ImageView.<init>(ImageView.java:105)
E/AndroidRuntime( 233): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime( 233): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
E/AndroidRuntime( 233): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
E/AndroidRuntime( 233): ... 22 more
E/AndroidRuntime( 233): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi/title_bar_shadow.9.png from draw
able resource ID #0x7f020032
E/AndroidRuntime( 233): at android.content.res.Resources.loadDrawable(Resources.java:1710)
E/AndroidRuntime( 233): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
E/AndroidRuntime( 233): at android.widget.ImageView.<init>(ImageView.java:115)
E/AndroidRuntime( 233): ... 26 more
E/AndroidRuntime( 233): Caused by: java.io.FileNotFoundException: res/drawable-mdpi/title_bar_shadow.9.png
E/AndroidRuntime( 233): at android.content.res.AssetManager.openNonAssetNative(Native Method)
E/AndroidRuntime( 233): at android.content.res.AssetManager.openNonAsset(AssetManager.java:391)
E/AndroidRuntime( 233): at android.content.res.Resources.loadDrawable(Resources.java:1702)
E/AndroidRuntime( 233): ... 28 more
Caused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi/title_bar_shadow.9.png
Make sure you have a file title_bar_shadow.9.png
in each of your folders res/drawable-mdpi/
, res/drawable-ldpi/
and res/drawable-hdpi/
. It seems that is missing from the -mdpi one.
精彩评论