Error:"Binary XML file Line #: Error inflating Class"
Cause: This exception is caused by an error in the layout file, so go back to the layout file and look at it.
<?XML version= "1.0" encoding= "Utf-8"?><Relativelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "vertical" > <ImageViewAndroid:id= "@+id/disclosureimg"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"android:layout_centervertical= "true"Android:layout_alignparentleft= "true"/> <TextViewAndroid:id= "@+id/contenttext"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"android:layout_centervertical= "true"Android:layout_torightof= "@id/disclosureimg"/> </Relativelayout>
There is a yellow exclamation point in the ImageView, the mouse is put up to display "[Accessibility] Missing contentdescription attribute on image", that is, the picture is missing text description .... , find a place to know how to do, the lack of instructions for him to add one.
android:contentdescription= "@string/icon_description"
The problem is solved after adding this attribute, so ... These small details need to pay more attention, try to avoid such a mistake ~
Another: can also refer to this friend's scheme--android runtime exception "Binary XML file Line #: Error inflating Class".
Android development problem Accumulation and solution (ii)