Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: Error parsing XML: mismatched tag

I am getting this error:

Error parsing XML: mismatched tag.

If anyone knows how to fix this, can you please let me know what I'm missing, thank you.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >


    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/android" >

    <Button
        android:id="@+id/btnChangeImage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Change Image" >

</LinearLayout>
like image 528
Harrison Avatar asked Apr 30 '15 23:04

Harrison


1 Answers

The closing tags for the <ImageView> and <Button> tags are missing.

You can add a / at the end of the tags to make them self-closing:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >


    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/android" />

    <Button
        android:id="@+id/btnChangeImage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Change Image" />

</LinearLayout>
like image 121
Guffa Avatar answered Oct 21 '22 10:10

Guffa