Resource not found: res / drawable / list_selector_background.xml?

I recently released my first app. Having tested only in the SDK emulator and on the Galaxy S2, the reviews about the devices that it works for coming to me were wonderful.

Unfortunately, I had several users who inform me about FC. A common factor between them is that they are both MIUI users (different IIRC devices).

One of them helped a lot in providing information and testing samples to solve the problem, but I just can't figure out how to do it.

I searched the Internet quite widely. Although I found people with similar reports, I had nothing to help solve this particular case that I see.

Distressed + Notes:

  • the problem is that res/drawable/list_selector_background.xml does not exist
  • I have not created custom resources for the background of the list, and I am not making references to this specific resource in my code
  • I am using ActionBarSherlock ( minSdkVersion == 7 , targetSdkVersion == 7 , project build target == 15 )
  • The crash occurs when loading preferences activity (which has android:theme="@style/Theme.Sherlock.Dialog" in the manifest)
  • the crash does not occur when loading another preference activity using the same method (starting from an intent with an activity class)

For reference:

What confuses me more is that the specific settings that I show in this preference activity will work when it was sub <PreferenceScreen> in the original XML preferences (I shared the preference lists separately, as it was more convenient for user).

Edit: It should be noted that this is an empty <PreferenceScreen> that is populated through code; it still worked when it was in one PreferenceActivity .

Here's how I get started with privileges, which works:

 Intent intent = new Intent(this, PreferencesActivity.class); startActivity(intent); 

And here's how I get started with privileges that fails:

 Intent subredditsIntent = new Intent(MainTabs.this, SubredditPreferencesActivity.class); startActivity(subredditsIntent); 

I just noticed that I am using MainTabs.this in the second , possibly due to copying it from a nested dialog class; Is this really not the reason, since it is called when called from a dialog box?

This is apparently limited to MIUI devices, but I cannot confirm this with 100% certainty. Has anyone else experienced this at all?

Any ideas would be much appreciated!

thanks

  • D
+1
source share
1 answer

I managed to get the "last capture" for a useful MIUI user. The only change I made was to remove android:theme="@style/Theme.Sherlock.Dialog" from the activity definition I am Manifest.

It seemed to work!

For reference, it seems to other people (at this time) that using a conversation topic for activity preferences triggers FC in MIUI.

I have not tested it yet if manually configuring the theme using the onCreate() method ends with FCing.

Hope this helps someone!

+1
source

Source: https://habr.com/ru/post/1487719/


All Articles