Delete and refresh items from a listview and database
<p>I cannot refresh my list view after deleting the records.</p>

<pre><code>        String str3 = favtitle.get(position);
        //position = Integer.parseInt(cur.getString(cur.getColumnIndex("id")));

                db.delete("Favorites7","title= '"+str3+"'",null);

                //mSchedule.notifyDataSetChanged();  
                cur.requery();

                cur= db.query("Favorites7", 
                        null, null, null, null, null, null);

                 cur.moveToFirst();
                  while (cur.isAfterLast() == false) {

                        //name.append("n" + cur.getString(1));
                       //mylist.addAll(cur.getString(i));
                      favtitle.add(cur.getString(1));
                      favloc.add(cur.getString(3));
                      favemp.add(cur.getString(2));
                      lat.add(cur.getString(7));
                      log.add(cur.getString(8));
                                //nextScreenData.add(cur.getString(2).toString());
                        cur.moveToNext();
                    }


                    cur.close();

                    mylist = new ArrayList&lt;HashMap&lt;String,Object&gt;&gt;();
                     HashMap&lt;String,Object&gt; map = new HashMap&lt;String, Object&gt;();

                     for(int i=0;i&lt;favtitle.size();i++)
                     {
                         map = new HashMap&lt;String, Object&gt;();
                     map.put("train",favtitle.get(i));
                     map.put("value",favloc.get(i));
                     map.put("employer",favemp.get(i));

                     mylist.add(map);
                     }
                    mSchedule.notifyDataSetChanged(); 
                mSchedule = new SimpleAdapter(Favorites.this, mylist, R.layout.listdelete,
                             new String[] {"train","value","employer"}, new int[] {R.id.dept,R.id.jobloc,R.id.employer});
                    lv.setAdapter(mSchedule);
                     lv.setDividerHeight(2);
                     lv.setCacheColorHint(Color.WHITE);
                     //cur.requery();
</code></pre>

<p>Thanx in advance.</p>
