Update listview after update database sqlite
<p>How to update items in listview after update the row on database sqlite. I have put notifyDataSetChanged() but not success, there is not error, but not refresh data in row. The data will change if I click menu back and open list again. So I want update the data in row after I update data. Below structur my code, Thanks.</p>

<pre><code>CustomBaseAdapter adapter;
ListView cListView;
</code></pre>

<p>in onCreate:</p>

<pre><code>cListView = (ListView) findViewById(R.id.list_category);
List&lt;ItemsArtikel&gt; rowItems = (List&lt;ItemsArtikel&gt;) db.getAllCategori(katname);
adapter = new CustomBaseAdapter(this, rowItems);
cListView.setAdapter(adapter);
</code></pre>

<p>Query listcategory:</p>

<pre><code>public List&lt;ItemsArtikel&gt; getAllCategori(String cat) {
    SQLiteDatabase db = this.getWritableDatabase();
    List&lt;ItemsArtikel&gt; cList = new ArrayList&lt;ItemsArtikel&gt;();
    String selectQuery = "SELECT  * FROM " + TABLE_CAT + " WHERE "
            + COLOM_KAT + "=\"" + cat + "\"";
    Cursor c = db.rawQuery(selectQuery, null);
    c.moveToFirst();
    if (c.getCount() &gt; 0) {
        do {
            ItemsArtikel kat = new ItemsArtikel();
            kat.setID(c.getLong(c.getColumnIndex(COLOM_ID)));
            kat.setName(c.getString(c.getColumnIndex(COLOM_NAME)));
            kat.setLink(c.getString(c.getColumnIndex(COLOM_LINK)));
            kat.setImage(c.getString(c.getColumnIndex(COLOM_IMAGE)));
            kategoriList.add(kat);
        } while (c.moveToNext());
    }
    return cList;
}
</code></pre>

<p>After i use for listview is presented <code>for</code> to download images and update each row the database using AsyncTask when download image. Image success downloaded and row also success updated, Just not refresh in listview.</p>

<p>This is code onPostExecute when download image:</p>

<pre><code>@Override
protected void onPostExecute(HashMap&lt;String, Object&gt; result) {
    String id = (String) result.get("id");
    String path = (String) result.get("image");

    // update row in database
    db.updateRowCategory(id, path);

    cListView.setAdapter(adapter);
    adapter.notifyDataSetChanged();
}
</code></pre>
