Note that there are some explanatory texts on larger screens.

plurals
  1. POOutputting ListView exception: File from xml type layout resource ID #0x102000a
    primarykey
    data
    text
    <p>I'm trying to output a list from an SQLite database and am getting this exception:</p> <p>android.content.res.Resources$NotFoundException: File from xml type layout resource ID #0x102000a</p> <p>After checking around on similar questions, I've made sure my ListView is defined as @id/android:list but still get the same exception. The problem occurs when the onCreate method in the ListActivity class completes. The getAllDiaryEntries() method does get the data from the db, but again, once it comes back to the ListActivity class and onCreate finishes I get the exception. Here's the relevant parts of code.</p> <p>This is the ListActivity class:</p> <pre><code>public class DiarySchedule extends ListActivity { private DiaryDataSource datasource; private static final String TAG = "DiaryDbAdapter"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.diary_schedule); datasource = new DiaryDataSource(this); datasource.open(); List&lt;DiaryEntry&gt; values = datasource.getAllDiaryEntries(); ArrayAdapter&lt;DiaryEntry&gt; adapter = new ArrayAdapter&lt;DiaryEntry&gt;(this, android.R.id.list, values); setListAdapter(adapter); } </code></pre> <p>Next we have the getAllDiaryEntries() method:</p> <pre><code>public List&lt;DiaryEntry&gt; getAllDiaryEntries() { List&lt;DiaryEntry&gt; diaryEntries = new ArrayList&lt;DiaryEntry&gt;(); Cursor cursor = database.query(DiaryDbAdapter.DIARY_TABLE, allColumns, null, null, null, null, null); cursor.moveToFirst(); while (!cursor.isAfterLast()) { DiaryEntry diaryEntry = cursorToDiaryEntry(cursor); diaryEntries.add(diaryEntry); cursor.moveToNext(); } // Make sure to close the cursor cursor.close(); return diaryEntries; } </code></pre> <p>And the layout (not styled or anything yet):</p> <pre><code>&lt;ListView android:id="@id/android:list" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; </code></pre> <p>I'm still pretty new to Android so may have missed something simple, but thanks in advance for any help.</p> <p>Edited - here's the cursortoDiaryEntry method</p> <p>private DiaryEntry cursorToDiaryEntry(Cursor cursor) { DiaryEntry diaryEntry = new DiaryEntry(); diaryEntry.setId(cursor.getLong(0)); diaryEntry.setTitle(cursor.getString(1)); diaryEntry.setDate(cursor.getString(2)); diaryEntry.setDescription(cursor.getString(3)); return diaryEntry; }</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload