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:
Eclipse flags the second TextView with this:
It's used in this code:
Can anybody tell me what I'm doing wrong?
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?