Question

Why does this XML give errors? (Relevant portion extracted from larger file.)

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    <!--  android:layout_gravity="center_horizontal|vertical" -->
    android:padding="5dip"
    />

This gives two errors:

Element type "TextView" must be followed by either attribute specifications, ">" or "/>".  
error: Error parsing XML: not well-formed (invalid token)
Was it helpful?

Solution

You can't use comment inside xml element. i.e. in TextView element only attribules (like name="some value") are allowed. That should be a fresh question...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top