Search code examples
javaandroidxmlpseudocodesgml

How to use Pseudo Code in a .xml file under res/layout folder? Android


So I want to tell myself some things withing the .xml file using Pseudo code but when I do the // it enters it like a code so I can't really use it in there. Is there something I could do to make the code non readable like Pseudo Code? I'm doing this in an android application. Under the res/layout/(.xml file) folder. Thanks!


Solution

  • 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" />