Which raises "RuntimeException: binary string of XML file # 20: you must specify the layout_height attribute". (ActionBarScherlock is suspected)?

I have an application with ActionBarScherlock and I use ACRA. I get crash reports from some users with the following error:

"java.lang.RuntimeException: Binary XML file line #20: You must supply a layout_height attribute.
    at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491)
    at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3602)
    at android.view.ViewGroup$LayoutParams.<init>(ViewGroup.java:3554)
    at android.widget.AbsListView$LayoutParams.<init>(AbsListView.java:4322)
    at android.widget.AbsListView.generateLayoutParams(AbsListView.java:4116)
    at android.widget.AbsListView.generateLayoutParams(AbsListView.java:74)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:332)
    at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
    at android.webkit.WebTextView$AutoCompleteAdapter.getView(WebTextView.java:650)
    at android.widget.AbsListView.obtainView(AbsListView.java:1430)
    at android.widget.AutoCompleteTextView$DropDownListView.obtainView(AutoCompleteTextView.java:1548)
    at android.widget.ListView.measureHeightOfChildren(ListView.java:1216)
    at android.widget.AutoCompleteTextView.buildDropDown(AutoCompleteTextView.java:1376)
    at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1140)
    at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:1022)
    at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:1005)
    at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:285)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3717)
    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:864)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
    at dalvik.system.NativeStart.main(Native Method)"

Of course, I tried to do this and found that it was most likely caused by ActionBarScherlock (and I noticed that every user who encountered this error was using android 2.3. *), But could not find a solution. It is a little confusing that I cannot reproduce this error on my own 2.3. * Device ...

So what causes this error?

+5
source share
4 answers

# 1 , ZTE. , , Webview Edittext/InputBox. Webview. , . - , .

ZTE. , .

    public static boolean disableWebViewAutoCompleteForDevicesThatCrash(WebView webView)
{
    // We may add some other bizarre devices to this list if the ZTE fix works well.
    if ("ZTE".equals(Build.MANUFACTURER))
    {
        webView.getSettings().setSaveFormData(false);
        webView.clearFormData();
        return true;
    }
    else
    {
        return false;
    }
}
+2

ActionBarsherlock.

Android android: theme = "@style/AppTheme" , , AppTheme "AppBaseTheme". !

<style name="AppTheme" parent="AppBaseTheme">

<style name="AppTheme" parent="Theme.Sherlock">

.

+14

layout_height ?attr/actionBarSize, @dimen/action_bar_height, : values/, values-land/ values-sw600dp/.

OEM-, , . , .

+2

I had the same problem and solved it by changing to AndroidManifest.xml. You should set the theme of a specific Activity or full application in Theme.Sherlock.Light(I think you can specify only Theme.Sherlock).

In the code, it will be:

<application 
    ... 
    android:theme="@style/Theme.Sherlock.Light">

or

<activity
    ... 
    android:theme="@style/Theme.Sherlock.Light">
+2
source

All Articles