Android - Resources$NotFoundException - android

I have an App with over 100.000 Users. But on some devices (~50) I get a strange exception. The stack traces says, that there is an drawable not found.
Here is the stack trace:
java.lang.RuntimeException: Unable to start activity ComponentInfo{mindmApp.the.big.bang.theory.quiz/mindmApp.the.big.bang.theory.quiz.GameNormalActivity}: android.view.InflateException: Binary XML file line #237: Error inflating class
...
Caused by: android.view.InflateException: Binary XML file line #237: Error inflating class
at android.view.LayoutInflater.createView(LayoutInflater.java:606)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
...
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:586)
... 28 more
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/textviewxml_joker.xml from drawable resource ID #0x7f02003d
at android.content.res.Resources.loadDrawable(Resources.java:1956)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.(View.java:2841)
at android.widget.TextView.(TextView.java:580)
at android.widget.TextView.(TextView.java:573)
I have no idea why this drawable (it's a xml-file) is not found.
The binary XML file line #237 is:
<TextView
android:id="#+id/textViewSkip"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_weight="1"
android:background="#drawable/textviewxml_joker"
android:gravity="center"
android:text="#string/tvSkip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/color_textview"
android:textSize="22sp" />
And here is the textviewxml_joker.xml file:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="#drawable/textview_joker_pressed"
android:state_pressed="true"/>
<item android:drawable="#drawable/textview_joker"/>
</selector>
Have anybody an idea t osolve this problem?
Best Regards!

If your textviewxml_joker.xml file isn't in drawable, but rather in a drawable-* folder, then those few devices that get the error may not meet the conditions to use the drawable-* folder.
Put it in drawable as well and it should fix it.

This could also happen if the resource you are referring to (lets call it ResA) is in-turn referring to a resource which is missing (lets call it ResB).
Android will raise the ResourceNotFoundException for ResA even though whats really missing is ResB. Such is life!
In my case, ResB was defined in the values-swxxxdp but not in values. Hence I was getting this exception on phones but not on tablets.

If you have multiple resource folders, make sure that Android finds your drawable xml for every possible qualifier combination (Providing Resources). Looking at the device types that have this error might give you a hint where to look.

Related

Fragment testing error: android.view.InflateException: Binary XML file line #16: Binary XML file line #16: Error inflating class <unknown>

I am trying to test a fragment, following these instructions: https://developer.android.com/training/basics/fragments/testing
However I am getting the following crash when calling launchFragmentInContainer from my test.
Stacktrace:
android.view.InflateException: Binary XML file line #16: Binary XML file line #16: Error inflating class <unknown>
Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class <unknown>
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
at android.view.LayoutInflater.$$robo$$android_view_LayoutInflater$createView(LayoutInflater.java:647)
...
at com.myapp.poll.PollHomeFragment.onCreateView(PollHomeFragment.kt:31)
...
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 13: TypedValue{t=0x2/d=0x7f0301b1 a=-1}
at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:946)
at android.content.res.TypedArray.getDrawable(TypedArray.java:930)
at android.view.View.__constructor__(View.java:5010)
at android.view.View.<init>(View.java)
at android.widget.TextView.<init>(TextView.java)
...
at com.myapp.poll.PollHomeFragment.onCreateView(PollHomeFragment.kt:31)
Here's the layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:gravity="center"
android:orientation="vertical"
tools:context=".poll.PollActivity">
<TextView
android:id="#+id/tvEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="asdf#asdf.com" />
<TextView <!-- This is line 16 -->
android:id="#+id/tvViewPoll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:minHeight="48dp"
android:text="View Poll" />
<TextView
android:id="#+id/tvCreatePoll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:minHeight="48dp"
android:text="Create Poll" />
OK, from an educated guess based on the stacktrace, I tried removing android:background="?attr/selectableItemBackground" and this resolves the issue.
It appears that ?attr/selectableItemBackground is perhaps not compatible with FragmentScenario or this is a framework bug.
I submitted a bug on the issue tracker: https://issuetracker.google.com/issues/144629519
Update from Google:
Status: Won't Fix (Intended Behavior) The default theme does not have
an app defined attribute ?attr/selectableItemBackground (as Fragment
has no dependency on AppCompat, MDC, etc)
It sounds like you should be passing the correct theme to
FragmentScenario:
launchFragmentInContainer<PollHomeFragment>(themeResId = R.style.Theme_YourTheme)
In Java one also has to pass the theme to the FragmentScenario. Else the Fragment will not know about the current theme and will eventually complain that one should set an AppCompat theme ...
FragmentScenario<SomeFragment> scenario = FragmentScenario.launchInContainer(
SomeFragment.class,
Bundle.EMPTY,
R.style.Theme_Custom,
null
);
For me, using "android:?attr/selectableItemBackground" instead, solved the problem

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.

Way to avoid layout file naming conflict among multiple Android projects

Currently, I have an Android project, consists of 1 main project, and multiple library projects.
Just that recently, I realize that if there is same layout filename among main project and library project, bad thing can happen.
third-party-library-project
- res
- layout
- actionbar_custom_view_done_discard.xml
main-project
- res
- layout
- actionbar_custom_view_done_discard.xml
So, if in third-party-library-project, if you are having line of code in its activity,
final View customActionBarView = inflater.inflate(
R.layout.actionbar_custom_view_done_discard, null);
Error stack trace caused by layout file naming conflict
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.yccheok.jstock.gui/group.pals.android.lib.ui.lockpattern.LockPatternActivity}: android.view.InflateException: Binary XML file line #24: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #24: 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.parseInclude(LayoutInflater.java:830)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:736)
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 group.pals.android.lib.ui.lockpattern.LockPatternActivity.initActionBar(LockPatternActivity.java:356)
at group.pals.android.lib.ui.lockpattern.LockPatternActivity.onCreate(LockPatternActivity.java:347)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
... 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: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x7f010137 a=-1}
at android.content.res.Resources.loadDrawable(Resources.java:1892)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.widget.TextView.<init>(TextView.java:614)
at android.widget.TextView.<init>(TextView.java:442)
... 28 more
If I change the layout XML file in third-party-library-project to actionbar_custom_view_done_discard1.xml, the runtime error will gone.
This is not an issues, if the number of library projects is small. Conflict can be solved easily with simple renaming. However, when comes across huge number of library projects, what is a robust way, or strategy to overcome this problem?
Library projects need to ensure that their resource names will be distinctive and not collide with other library projects, such as by applying a prefix to those resource names.
Note that apparently the new Gradle-based build system supports resource subdirectories. I have not yet experimented with this, but if the subdirectory names form part of the resource ID, then putting your resources in a distinctive subdirectory would help to keep the resource IDs distinct (at least for non-values resources).
First I would suggest renaming your project resource file and not the 3rd party file in your first example since you may want to pull changes from the 3rd party library project again. Secondly I would suggest not using too many 3rd party library projects to begin with. From my experience the Android build system still has lots of hiccups with library projects. Things like BuildConfig.DEBUG do not work and I've had issues with library projects that contain jar file dependencies breaking the ability to run unit tests through Android instrumentation. There are tons of other bugs as well, most of them probably fairly obscure but enough of an issue that I don't suggest using library projects any more than absolutely necessary.

How to set xmlns path in PreferenceScreen - modified ListPreferenceMultiSelect

I have the code downloaded from site: http://blog.350nice.com/wp/archives/240
But on the line:
<com.threefiftynice.android.preference.ListPreferenceMultiSelect
Is error code:
Multiple annotations found at this line:
- error: No resource identifier found for attribute 'checkAll' in package
'com.threefiftynice.android'
- error: No resource identifier found for attribute 'separator' in package
'com.threefiftynice.android'
This is XML with error:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:key="prefKey"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:threefiftyprefs="http://schemas.android.com/apk/res/com.threefiftynice.android">
<com.threefiftynice.android.preference.ListPreferenceMultiSelect
threefiftyprefs:checkAll="check" threefiftyprefs:separator="|"
android:defaultValue="#ALL#"
android:key="key"
android:title="Image folders to monitor" android:dialogTitle="Image folders to monitor"
android:summary="Specify which folders should be monitored for images"
android:entries="#array/typeOfPoints"
android:entryValues="#array/typeOfPointsID"/>
</PreferenceScreen>
I know xmlns and the path to ListPreferenceMultiselect ist bad - but I tried a lot of possible paths and problem was with all of them (this is the original path from the site with original packages). This is my structure of the code
:
How should I set the path to make it work? Thank you very much.
EDIT:
After chanded it to xmlns:threefiftyprefs="schemas.android.com/apk/res-auto" it does not write error in xml but it throws error on run:
Uncaught handler: thread main exiting due to uncaught exception
java.lang.RuntimeException: Unable to start activity
ComponentInfo{goandknow.proximityalerts/goandknow.proximityalerts.EditPreferences}:
android.view.InflateException: Binary XML file line #24: Error
inflating class
com.threefiftynice.android.preference.ListPreferenceMultiSelect at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
at android.app.ActivityThread.access$1800(ActivityThread.java:112)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
at android.os.Handler.dispatchMessage(Handler.java:99) at
android.os.Looper.loop(Looper.java:123) at
android.app.ActivityThread.main(ActivityThread.java:3948) 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:782)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) at
dalvik.system.NativeStart.main(Native Method) Caused by:
android.view.InflateException: Binary XML file line #24: Error
inflating class
com.threefiftynice.android.preference.ListPreferenceMultiSelect at
android.preference.GenericInflater.createItemFromTag(GenericInflater.java:441)
at
android.preference.GenericInflater.rInflate(GenericInflater.java:481)
at
android.preference.GenericInflater.rInflate(GenericInflater.java:493)
at
android.preference.GenericInflater.inflate(GenericInflater.java:326)
at
android.preference.GenericInflater.inflate(GenericInflater.java:263)
at
android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:250)
at
android.preference.PreferenceActivity.addPreferencesFromResource(PreferenceActivity.java:253)
at
goandknow.proximityalerts.EditPreferences.onCreate(EditPreferences.java:24)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
... 11 more
This is line 24:
com.threefiftynice.android.preference.ListPreferenceMultiSelect
change the line
xmlns:threefiftyprefs="http://schemas.android.com/apk/res/com.threefiftynice.android"
to
xmlns:threefiftyprefs="http://schemas.android.com/apk/res-auto"
This is how it should be:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:key="prefKey"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:threefiftyprefs="schemas.android.com/apk/res-auto">
<goandknow.models.ListPreferenceMultiSelect
threefiftyprefs:checkAll="check" threefiftyprefs:separator="|"
android:defaultValue="#ALL#"
android:key="key"
android:title="Image folders to monitor" android:dialogTitle="Image folders"
android:summary="Specify which folders should be monitored for images"
android:entries="#array/typeOfPoints"
android:entryValues="#array/typeOfPointsID"/>
</PreferenceScreen>
Important:
xmlns:threefiftyprefs="schemas.android.com/apk/res-auto"
goandknow.models.ListPreferenceMultiSelect Thanks to Sankar V.

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.

Categories

Resources