Comments in Android Layout xml


Question

I would like to enter some comments into the layout XML files, how would I do that?

1
140
2/20/2018 1:46:16 PM

As other said, the comment in XML are like this

<!-- this is a comment -->

Notice that they can span on multiple lines

<!--
    This is a comment
    on multiple lines
-->

But they cannot be nested

<!-- This <!-- is a comment --> This is not -->

Also you cannot use them inside tags

<EditText <!--This is not valid--> android:layout_width="fill_parent" />
247
8/14/2010 7:12:40 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon