Android manifest with empty XML tags?

In the manifest of my application, the actions are highlighted in yellow and marked:

XML tag has an empty body

Reports an empty tag tag. Validation is performed in XML / JSP / JSPX / HTML / XHTML files

enter image description here

I am looking for information, but do not quite understand what this message is.

I appreciate any help to know what I'm doing wrong.

+5
source share
3 answers

XML tag has an empty body

Applies to <activity> tags when you close them with </activity> instead of <activity (rest of code here...) />

Using explicit </activity> means that your <activity> has a body, for example, in this example:

 <activity android:name=".SplashActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> 

While you want something in this direction:

 <activity android:name=".MainActivity" android:label="@string/app_name" /> 

C /> at the end to get rid of these warnings

+11
source

Yes, your working body is empty. This is not a fatal error, just replace ></activity> />

+2
source

XML has two types of tags: empty tag () and non-empty tags (body) Warning because of the tag "" having an empty body, it closes it, as shown below, if the body is empty.

 <activity ... /> 
+1
source

All Articles