Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid reload ListView data from SQLite
    primarykey
    data
    text
    <p>I had a ListView that loads data from the SQLite database and onClickListener for each list that opens up to a new activity. My problem now is that when I press "Back" to go back to the previous activity with the ListView, it doesn't show. </p> <p>How do I reload the list from database again? How do I go about it? </p> <p>Does it have anything to do with notifyDataSetChanged()? </p> <p>Please help.</p> <p>Thank you.</p> <p><strong>EDITED:</strong></p> <p>Below are my codes to load the ListView under onCreate():</p> <pre><code> ListView listContent = (ListView) findViewById(R.id.contentlist); mySQLiteAdapter = new SQLiteAdapter(this); mySQLiteAdapter.openToRead(); Cursor cursor = mySQLiteAdapter.queueAll(); startManagingCursor(cursor); String[] from = new String[] { SQLiteAdapter.KEY_CONTENT }; int[] to = new int[] { R.id.text }; SimpleCursorAdapter cursorAdapter = new SimpleCursorAdapter(this, R.layout.listrow, cursor, from, to); listContent.setAdapter(cursorAdapter); mySQLiteAdapter.close(); //Onclick ListView setlistener listContent.setTextFilterEnabled(true); listContent.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) { Intent summaryIntent = new Intent(DocumentListActivity.this, ViewDocumentActivity.class); listTopic = ((TextView) view).getText().toString(); summaryIntent.putExtra("SummTopic", listTopic); startActivity(summaryIntent); } }); </code></pre> <p>So what to add in the Resume()?</p>
    singulars
    1. This table or related slice is empty.
    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.
    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