title: How to delete row in Sqlite with ContextMenu?
body: <p>I want to delete row in Sqlite database. Opening pop up when pressed long on Listview.(Popup opens with ContextMenu). Pop up is include two options:"Delete","Update". When pressed "Delete" I want to delete that row.</p>
  
  <pre><code>@Override
  public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {
      super.onCreateContextMenu(menu, v, menuInfo);
      menu.setHeaderTitle("Select Action");
      menu.add(0, v.getId(), 0, "Delete");
      menu.add(0, v.getId(), 0, "Update");
  }
  
  @Override
  public boolean onContextItemSelected(MenuItem item) {
      ListView lst=(ListView) findViewById(R.id.ListViewVeriler);
  
      if(item.getTitle()=="Delete"){function1(item.getItemId());}
      else if(item.getTitle()=="Update"){function2(item.getItemId());}
      else {return false;}
      return true;
  }
  
  public void function1(int id){
      ListView lst=(ListView) findViewById(R.id.ListViewVeriler);
      VeriTabani vt=new VeriTabani(MainActivity.this); 
     //VeriTabani is my database class
      int idd=(int)lst.getSelectedItemId();
      vt.VeriSil(idd);
    //VeriSil is delete method in VeriTabanı class
      Toast.makeText(this, "Deleted Succesfully", Toast.LENGTH_SHORT).show();
  }
  public void function2(int id){
      Toast.makeText(this, "Update Person", Toast.LENGTH_SHORT).show();
     // I will open UpdateAction here
  }
  
  
  public void VeriSil(int id){
  
      SQLiteDatabase db = this.getWritableDatabase();
  
      try {
                     db.delete(TABLO_KISILER, ROW_ID_ + " = ?",
                  new String[] { String.valueOf(id) });
      }
      catch (Exception e){
      }
      db.close();
  }
  </code></pre>