adding delete button to listview in android
<p>i have a list view and i want to mimic the functionality of 
UITableViewEditingStyle in iphone . 
I want the listview to have a delete button and when the user clicks the deleting button, that particular row should get deleted not only from the database but also from the listview.</p>

<p>I am using ListActivity.</p>

<p>Thank you for your help.</p>

<p>Here is the code that i am using</p>

<p>import android.R.anim;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.SimpleAdapter;
import android.widget.SimpleCursorAdapter;</p>

<p>public class EditSiteList extends ListActivity {</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.editsitelist);
    HandleDatabase db = new HandleDatabase(null,null,null);
    String names[] = db.getSites();
    ListAdapter la = new Arraydapter(this,R.layout.editsiterow,R.id.sitename,names);
    HandleDatabase hd = new HandleDatabase(null, null, null);
            hd.getSitesCursor(), new String[]{"name"}, android.R.id.);
    setListAdapter(la);
}
</code></pre>
