Android app, The markup in the document following the root element must be well-formed

后端 未结 4 1844
遥遥无期
遥遥无期 2021-01-14 10:31

I had started to work on some android tutorial demo\'s from below link module 6.1 Project http://www.vogella.de/articles/Android/article.html

Am getting following er

相关标签:
4条回答
  • 2021-01-14 11:13

    Where do the last menu tag come from? You should only have one root (ie 1st level) tag, which would be LinearLayout here.

    0 讨论(0)
  • 2021-01-14 11:21

    The <menu> needs to go into its own file.

    XML always has one pair of enclosing tags (e.g. <foo> </foo> where all other elements go in between. This is not the case in your example.

    0 讨论(0)
  • 2021-01-14 11:32

    Well formed XML has one root element (this is excluding the header), so essentially what it complains about is that in your root you have two elements: LinearLayout and Menu. Wrap these in another layout element or move the menu into the LinearLayout and it should be fine.

    0 讨论(0)
  • 2021-01-14 11:32

    I agree with the diagnose, but then the error message badly needs rephrasing: "The markup in the document following the root element must be well-formed." It suggests that there can be some 'markup in the document following the root element', and that it should be well-formed. In reality the root element must not be followed by anything at all. So there is no way that any text could be well formed.

    0 讨论(0)
提交回复
热议问题