You must supply a layout_width attribute in some devices - android

I am experiencing this problem in my app and I can't seem to understand how it happen. It only occurs in Samsung Galaxy Y phone, I tried this code in other devices and it is ok.
java.lang.RuntimeException: Unable to start activity ComponentInfo{jpac.remaster.gtc/jpac.remaster.gtc.GTCSplash}: java.lang.RuntimeException: Binary XML file line #7: You must supply a layout_width attribute.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1658)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1674)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3735)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:662)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Binary XML file line #7: You must supply a layout_width attribute.
at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491)
at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3598)
at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:3678)
at android.widget.RelativeLayout$LayoutParams.<init>(RelativeLayout.java:1169)
at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:998)
at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:74)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:625)
at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
at android.app.Activity.setContentView(Activity.java:1657)
at jpac.remaster.gtc.GTCSplash.onCreate(GTCSplash.java:33)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
... 11 more
Can anyone help me with this? btw, here is the xml in question:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/tuna" >
<ImageView
android:id="#+id/dev_logo"
android:layout_width="#dimen/speech_height"
android:layout_height="#dimen/badge_height"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:contentDescription="#string/empty"
android:scaleType="centerInside"
android:src="#drawable/logo_dark" />
</RelativeLayout>
Also the activity for this xml file is the main entry point of the app.
Thanks in advance.

If you have dimensions (or any other values or resources) specified for particular densities or screen sizes, make sure you also have them defined in the generic directory (i.e. "values", "drawable")

Related

Android 2.3.x crashing on com.google.android.gms.location.LocationSettingsResult.startResolutionForResult

I'm in middle of a big issue,
OS VERSION: Android 2.3.x
DEVICE: GT i9100 (samsung galaxy s II)
LOCATION API: com.google.android.gms:play-services-location:9.4.0
PROBLEM: app crash calling
com.google.android.gms.location.LocationSettingsResult.startResolutionForResult
com.google.android.gms.ui E/AndroidRuntime: FATAL EXCEPTION: main java.lang.RuntimeException: Binary XML file line #25: You must supply a layout_height attribute.
FATAL EXCEPTION: main
java.lang.RuntimeException: Binary XML file line #25: You must supply a layout_height attribute.
at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:543)
at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3599)
at android.view.ViewGroup$MarginLayoutParams.(ViewGroup.java:3678)
at android.widget.LinearLayout$LayoutParams.(LinearLayout.java:1400)
at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1326)
at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:47)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:625)
at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2261)
at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2316)
at com.android.internal.policy.impl.PhoneWindow.getDecorView(PhoneWindow.java:1478)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2165)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1672)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3691)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
at dalvik.system.NativeStart.main(Native Method)
please refer the following link, i've exactly same issue
https://code.google.com/p/android/issues/detail?id=215183
please help me to fix this
Thanks
Please check solution given in this related SO post by #frieza if it can help.
As suggested, aside from defining layout_height and layout_width attributes shown in the posted codes, you might need to also set parent attribute with parent="android:Theme".
Hope that works for you too.

android.view.InflateException: Binary XML file line #1: Error inflating class <unknown> background pic

I have a activity with a Background Image - now I would like to Change it and copied the new one in the drawable-hdmi Folder - rename it to Background an have deleted the old one in the Folder
but now I can put None Picture as Background - every time appears above mentioned error
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:background="#drawable/background"
>
What can I do - have cleaned it already
02-11 21:58:33.653 10226-10226/de.tetzisoft.virjouthrger E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{de.tetzisoft.virjouthrger/de.tetzisoft.virjouthrger.ICit_A}: android.view.InflateException: Binary XML file line #1: Error inflating class
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2071)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2096)
at android.app.ActivityThread.access$600(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1207)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:4787)
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:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class
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.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at de.tetzisoft.virjouthrger.ICit_A.onCreate(ICit_A.java:16)
So say Android Studio
1) Make sure you name your resource "background" and not "Background". It's case-sensitive.
2) If you changed the resource using Windows Explorer and not Android Studio, refresh the project to update the resources.
3) You spelled your drawable folder like this "drawable-hdmi". It should be "drawable-hdpi".
4) Put the resource in "drawable" (default folder) just in case your device's density is mdpi or lower.
Have you tried naming it something else? Also even though you refer to it as background, have you made sure it keeps its .png extension?
Try cleaning and rebuilding your project,invalidate caches and restart.
Finally, open the folder for your app in finder and assure that background.png is in there.

Android Google Maps V2 Error inflating fragment

I've seen dozens of similar problems but none have seemed to fix my issue. I have an app that uses google maps v2 (previously used v1). I imported google-play-services and android-support-v4, and created an activity that extended SupportFragment (also tried just fragment). I added all permissions and my key to the manifest, and created a fragment in my layout folder which defines the map. However, my app crashes every time I call setContentView on my fragment within my activity. I imported android.support.v4.app.FragmentActivity and android.support.v4.app.Fragment in this activity, but get an error trying to inflate the fragment. The logcat log is listed below. Thanks in advance!
public class ManualCheckInMapActivity extends android.support.v4.app.FragmentActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map_fragment);
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<fragment
android:name="com.google.android.gms.maps.SupportMapFragment"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.safehouse.onguardianmobile/com.safehouse.onguardianmobile.ManualCheckInMapActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:582)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:200)
at android.app.Activity.setContentView(Activity.java:1647)
at com.safehouse.onguardianmobile.ManualCheckInMapActivity.onCreate(ManualCheckInMapActivity.java:40)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
... 11 more
Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.SupportMapFragment: make sure class name exists, is public, and has an empty constructor that is public
at android.support.v4.app.Fragment.instantiate(Fragment.java:401)
at android.support.v4.app.Fragment.instantiate(Fragment.java:369)
at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:272)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:558)
... 20 more
Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.SupportMapFragment in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.safehouse.onguardianmobile-2.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
at android.support.v4.app.Fragment.instantiate(Fragment.java:391)
... 23 more
UPDATE: I tried cleaning the project, but now get this error. I'm still new at this, no maybe I did not add the libraries properly?
Errors occurred during the build.
Errors running builder 'Android Package Builder' on project 'google-play-services_lib'.
Problems encountered while deleting resources.
Could not delete 'C:\Users\Travis\workspace\google-play-services_lib\bin\google-play-services_lib.jar'.
Problems encountered while deleting files.
Could not delete: C:\workspace\google-play-services_lib\bin\google-play-services_lib.jar.
Problems encountered while deleting resources.
Could not delete 'C:\workspace\google-play-services_lib\bin\google-play-services_lib.jar'.
Problems encountered while deleting files.
Could not delete: C:\Users\Travis\workspace\google-play-services_lib\bin\google-play-services_lib.jar.

org.xmlpull.v1.XmlPullParserException for "invalid drawable tag bitmap"

Ok, that's weird.
I've received this error for one of my activities, the weird thing is that the bitmap is used in every Activity! I don't even know how to reproduce the exception, it's working fine for me (and others I think).
This is the whole stacktrace:
java.lang.RuntimeException: Unable to start activity ComponentInfo{it.enrichman.bolloauto/it.enrichman.bolloauto.activities.ArchivioActivity}: android.view.InflateException: Binary XML file line #15: Error inflating class android.widget.ListView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1872)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1893)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1054)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:4385)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class android.widget.ListView
at android.view.LayoutInflater.createView(LayoutInflater.java:518)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:250)
at android.app.Activity.setContentView(Activity.java:1742)
at it.enrichman.bolloauto.activities.ArchivioActivity.onCreate(ArchivioActivity.java:36)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1836)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
at android.view.LayoutInflater.createView(LayoutInflater.java:505)
... 22 more
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/backrepeat.xml from color state list resource ID #0x7f020075
at android.content.res.Resources.loadColorStateList(Resources.java:1855)
at android.content.res.TypedArray.getColor(TypedArray.java:319)
at android.widget.AbsListView.<init>(AbsListView.java:632)
at android.widget.ListView.<init>(ListView.java:164)
at android.widget.ListView.<init>(ListView.java:160)
... 25 more
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #2: invalid drawable tag bitmap
at android.content.res.ColorStateList.createFromXmlInner(ColorStateList.java:146)
at android.content.res.ColorStateList.createFromXml(ColorStateList.java:129)
at android.content.res.Resources.loadColorStateList(Resources.java:1852)
... 29 more
The "missing" resource is this one (inside drawable folder):
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="#drawable/bg"
android:tileMode="repeat" />
The "bg" drawable is inside drawable-hdpi (could be that a problem?), but as I said it's used in every activity as background!
The error is called during the setting of the layout:
setContentView(R.layout.archivio);
The xml layout is this one:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BLABLABLA"
android:id="#+id/archivioTextView" android:layout_gravity="center_horizontal"
android:gravity="center_horizontal" android:textIsSelectable="false" android:layout_marginTop="10dp"
android:layout_marginBottom="10dp" android:layout_marginRight="30dp" android:layout_marginLeft="30dp"/>
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/listaVeicoli" android:layout_gravity="center" android:drawSelectorOnTop="false"/>
</LinearLayout>
(Some of the useless statements are put by the Designer of IntelliJ!)
I've looked for similar problems but I don't have "strange" id like #+id/list or other problems that other users encuntered..
Any help on this? What am I missing?
Thanks
In the end I've found FINALLY the solution.
I've tried with different emulator and I was having this crash only with API 10 (2.3.3) or less. Looking around the xmls and trying to do different stuff (also copying the bg drawable everywhere, or changing id to my list) I've found this weird stuff in my custom theme:
<item name="android:windowBackground">#drawable/backrepeat</item>
<item name="android:colorBackground">#drawable/backrepeat</item>
This seems to be not a problem for newer android version but for older one yes.
Just remove the colorBackground definition (that maybe should be only a color) and that's it!
I hope this will help someone else!
Create a drawable folder inside res folder.
Try keeping your bg inside "res/drawable/".
Hope this will help you.
Put your selector into the res/drawable folder and also give the Listview id as android:id="#+android:id/list".
I hope it will help you out.
Thanks.

Why is my app trying to use drawable-mdpi/title_bar_shadow.9.png?

The app works fine on HPDI and MDPI, but when run in an LDPI (v2.0) emulator, I get the exception and stack trace below.
Why is it looking for this image? (it's not referenced in my application, I've checked). The starter activity has disabled the title bar in any case.
If the OS expects this image, why is it not present?
Why is the exception relating to an MPDI image, when the emulator is LDPI?
04-20 11:35:19.432: ERROR/AndroidRuntime(236): Uncaught handler: thread main exiting due to uncaught exception
04-20 11:35:19.502: ERROR/AndroidRuntime(236): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.spondle/com.spondle.EventsActivity}: android.view.InflateException: Binary XML file line #14: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2454)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)
at android.app.ActivityThread.access$2200(ActivityThread.java:119)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4310)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:513)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
at android.app.Activity.setContentView(Activity.java:1622)
at com.spondle.EventsActivity.onCreate(EventsActivity.java:38)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at android.widget.ImageView.<init>(ImageView.java:105)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
... 23 more
Caused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi/title_bar_shadow.9.png from drawable resource ID #0x7f02002a
at android.content.res.Resources.loadDrawable(Resources.java:1710)
at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
at android.widget.ImageView.<init>(ImageView.java:115)
... 27 more
Caused by: java.io.FileNotFoundException: res/drawable-mdpi/title_bar_shadow.9.png
at android.content.res.AssetManager.openNonAssetNative(Native Method)
at android.content.res.AssetManager.openNonAsset(AssetManager.java:391)
at android.content.res.Resources.loadDrawable(Resources.java:1702)
... 29 more
If the OS expects this image, why is it not present?
Why is the exception relating to an MPDI image, when the emulator is LDPI?
If the requested resource (title_bar_shadow.9.png) is not present in drawable-ldpi (and it wasn't until Android 2.3), Android will try to find the best match (drawable-mdpi will be the next folder to search in). Anyway, the file will not be found there either (again, it was not there until Android 2.3). So the next step would be to search for it in drawable-hdpi (where it can be found). But apparently the search stops on drawable-mdpi (which is strange... maybe a bug in Android 2.1? you could try Android 2.2 emulator)
Why is it looking for this image? (it's not referenced in my application, I've checked). The starter activity has disabled the title bar in any case.
This image (shadow) is not used by the title bar. It is displayed UNDER the title bar.
To make it disappear, you have to create your own theme, like this:
<style
name="Theme"
parent="android:Theme.NoTitleBar">
<item
name="android:windowContentOverlay">#null</item>
</style>
I solved this problem making a copy of the images from drawable-ldpi/mdip/hdpi to a drawable (only drawable) folder. Put in this folder your low resolution images.
You don't need to have a title_bar_shadow.9.png file on these folders.

Categories

Resources