long click and bob menu
<p>I don't know ho to handle delete and edit in this code </p>

<pre><code>@Override  
public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);  
    menu.setHeaderTitle("Select");  
    menu.add(0, R.id.editt, 0, "Edit");  
    menu.add(0, R.id.delete, 0, "Delete");  
    menu.add(0, R.id.DeleteAll, 0, "delete all");
}  

public boolean onContextItemSelected(MenuItem item) {
    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
    switch(item.getItemId())
    {
    case R.id.editt: {
        Intent ed  = new Intent(DsTest2Activity.this, Edit.class);
        startActivity(ed);
        break; }

    case R.id.delete: {

        break; }

    case R.id.DeleteAll: {
        SQLiteDatabase ld = openOrCreateDatabase(dbName, Context.MODE_PRIVATE, null);
        ld.delete(tableName, null, null);
        String[] from = {"task", "_id"};
        int[] to = {R.id.textview_id,R.id.checkbox_id};

        SimpleAdapter sa = new SimpleAdapter(this, lc, R.layout.checkbox, from, to);
        ListView li = (ListView) findViewById(R.id.listview_id);
        li.setAdapter(sa);
        sa.notifyDataSetChanged();
        li.setVisibility(ListView.INVISIBLE);
        break; }

    default: { return true; }

    }

    return super.onContextItemSelected(item);
}
</code></pre>

<p>When user press long click on </p>

<pre><code>li.setOnItemLongClickListener(new OnItemLongClickListener() {
    public boolean onItemLongClick(AdapterView&lt;?&gt; adapter, View view, int position, long id)
    {   
        registerForContextMenu(li);
        return false;
    }
});
</code></pre>
