У меня странные ошибки в моем приложении, но только в Android 4.1 и Samsung Galaxy Note & Tab серии:Android - Ошибка класса inflatinc - java.lang.NumberFormatException
Galaxy Tab2 10,1 (espresso10wifi), Galaxy Note 10.1 (p4noterf), Galaxy Tab2 10,1 (espresso10rf), Galaxy Note 10.1 (p4notewifi), Galaxy Note 10.1 (p4notewifiww), Galaxy Tab 7,7 (GT-P6800), Galaxy Note 10.1 (p4notelte)
эмуляторы работают нормально, у меня есть испытал с Galaxy S3 & S4, также было в порядке.
Любая помощь будет оценена :) стек ошибок начинается так:
java.lang.NumberFormatException - java.lang.Integer.invalidInt
android.view.InflateException: Binary XML файл строка # 34 : раздувание ошибки класс в android.view.LayoutInflater.createView (LayoutInflater.java:613) ... ... в aAdapter.getView (aAdapter.java:82)
В моем адаптере, 82th линия просто надувается:
row = inflater.inflate (layoutResourceId, parent, false);
Мой ListView файл элемент XML выглядит следующим образом:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id = "@+id/tr1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:shrinkColumns="*"
android:stretchColumns="*"
android:layout_margin="1dp"
android:padding="5dip" >
<LinearLayout
android:id = "@+id/l1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:orientation="vertical" >
<LinearLayout
android:id = "@+id/lChecked"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<CheckBox
android:id="@+id/chkChecked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:gravity="center_vertical|end"
android:padding="5dp" />
<TextView
android:id="@+id/txtANo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:padding="5dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="16sp"
android:textColor="@android:color/white"
android:textStyle="bold" />
<TextView
android:id="@+id/txtPageNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:textSize="13sp"
android:textColor="@android:color/white"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:id="@+id/llSeparator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:orientation="horizontal"
android:background="#dedede" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:textAlignment ="gravity"
android:textDirection="rtl"
android:layoutDirection ="rtl"
android:gravity="right" >
<TextView
android:id="@+id/txtABody"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:textAlignment ="gravity"
android:padding="5dp"
android:layoutDirection ="rtl"
android:gravity="right"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textDirection="rtl"
android:textSize="20sp"
android:textColor="@android:color/white"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</TableRow>
</TableLayout>
Stacktrace говорит: InflateException: двоичная строка XML-файла # 34. Если макет, который вы разместили, тот, который вы используете, говорит вам, что проблема заключается в TextView. Испытайте, оставив barebone TextView, по крайней мере, вы бы изолировали проблему. Затем попробуйте добавить 1 атрибут за раз, пока не найдете тот, который вызывает ошибку (моя дикая догадка - андроид: attr/textAppearanceMedium) – momo
Кстати, разве у вас нет такой строки в вашей трассе стека? Вызвано: java.lang.NumberFormatException: Invalid int: "? 2130772074" Номер должен дать вам представление о том, что является неправильным атрибутом. – momo