• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Xml error help

matio

Lurker
Apr 15, 2010
1
0
Hi everyone, I'm trying to develop a todo app with the android sdk and eclipse, so far I've got a list view and I am able to create, edit and delete todo items. The problem I'm having is with the xml file that defines a row in the list view:
PHP:
<?xml version="1.0" encoding="utf-8"?>

<TextView 
    android:id="@+id/text1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    xmlns:android="http://schemas.android.com/apk/res/android">
</TextView>

<TextView 
    android:id="@+id/text2" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    xmlns:android="http://schemas.android.com/apk/res/android">
</TextView>

Eclipse flags the second TextView with this:
Code:
Multiple annotations found at this line:
    - error: Error parsing XML: junk after document element
    - The markup in the document following the root element must be well-
     formed.


It's used in this code:
PHP:
    private void getData() {
        mCursor = mDb.fetchAllItems();
        startManagingCursor(mCursor);

        String[] cols = new String[]{ ListDbAdapter.DB_ITEM, ListDbAdapter.DB_PRI };
        int[] views   = new int[]{ R.id.text1, R.id.text2 };
        SimpleCursorAdapter row_cursor =
            new SimpleCursorAdapter(this, R.layout.list_row, mCursor, cols,
                    views);
        setListAdapter(row_cursor);
    }


// --- db handle
    public Cursor fetchAllItems() {
        return listDb.query(DB_TABLE, new String[] {DB_ROWID, DB_ITEM, DB_PRI},
                null, null, null, null, null);
    }

Can anybody tell me what I'm doing wrong?
 

Attachments

  • List.zip
    133.8 KB · Views: 71

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones