开发者

Android Application, xml file errors :(

开发者 https://www.devze.com 2023-01-14 08:30 出处:网络
So I\'m trying to follow this tutorial... to learn android, and I\'m having a hard time because I feel like the tutorial was written with errors, and itshard to try and learn when you are teaching you

So I'm trying to follow this tutorial... to learn android, and I'm having a hard time because I feel like the tutorial was written with errors, and its hard to try and learn when you are teaching yourself errors..

Here is what the tutorial says:

Start by creating a new todolist_item.xml resource in the res/layout folder. It will specify how each of the to-do list items is displayed. For this example, your layout need only consist of the new TodoListItemView, set to fi ll the entire available area.

<?xml version=”1.0” encoding=”utf-8”?>
<com.paad.todolist.TodoListItemView
xmlns:android=”http://schemas.android.com/apk/res/android”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”
android:padding=”10dp”
android:scrollbars=”vertical”
android:textColor=”@color/notepad_text”
android:fadingEdge=”vertical”
/>

So i created a file in the res/layout folder, called todolist_item.xml and the file contains the following:

<?xml version=”1.0” encoding=”utf-8”?>
<com.paad.todolist.TodoLis开发者_开发技巧tItemView
    xmlns:android=”http://schemas.android.com/apk/res/android”
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dp"
    android:scrollbars="vertical"
    android:textColor="@color/notepad_text"
    android:fadingEdge="vertical"
/>

and i get the following error:

"Multiple annotations found at this line: - error: Error parsing XML: XML declaration not well-formed - The value following "version" in the XML declaration must be a "

I am also getting this on another xml file... anyone able to see what i've done wrong?


You seem to have a funny character for your double-quotes in the <?xml version=”1.0” ... tag, as opposed to a straight " character.

What type of file encoding / keyboard layout do you use?


This type of problem arises when u have put something in xml which is not required.U can solve it out by carefully writting XML file with proper structure.

EG.

android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" />

U can have layout..set its properties..within it u can add widgets ...add property..and then end layout....

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号