Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to comment out line(s) in xml in AndroidStudio?

I have the following piece of code in my AndroidManifest.xml file in which I want to comment out a single line (for quick testing purposes). By choosing the AndroidStudio-comment function I get the following:

<application
    android:allowBackup="true"
    android:icon="@mipmap/myicon"
    android:label="@string/app_name"
    android:supportsRtl="true"
    <!--android:theme="@style/AppTheme"-->
    android:theme="@style/ThemeOverlay.AppCompat.ActionBar" >

However, this creates a compilation error:

Error:Element type "application" must be followed by either attribute specifications, ">" or "/>".

Is there a simple way to comment out a (block of) line(s), or should I open an external text editor and copy-and-paste the original (block of) line(s) to that external text editor?

like image 274
Alex Avatar asked Nov 01 '25 05:11

Alex


1 Answers

You can comment out side the tag Like :

<application
    android:allowBackup="true"
    android:icon="@mipmap/myicon"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/ThemeOverlay.AppCompat.ActionBar" >

 <!--android:theme="@style/AppTheme"-->

Not inside the tag.

like image 104
RKM Avatar answered Nov 02 '25 20:11

RKM



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!