title: Deleting a row in sqlite database on a click of a button
body: <p>dhelper.java- the deleteshowById2 function is called on click of a button from the activity class function name delete Row, in this function the class context is passed and the name is also passed.</p>
  
  <pre><code>public static int deleteShowById2(String name, Context ctx) {
  
      DBHelper dbHelper = new DBHelper(ctx);
      SQLiteDatabase db = dbHelper.getReadableDatabase();
  
      String where = "showId='"+name+"'";
      return db.delete(TableName, where, null);
  
  
  }
  </code></pre>
  
  <p>Activity class</p>
  
  <pre><code>public void deleteRow()
  {
      name=e1.getText().toString();
      MyfirstPojo ob=new MyfirstPojo();
      ob.setName(name);
      int i=0;
      i=dheloper.deleteShowById2(name,this);
      if(i&gt;0){
          Toast.makeText(this, "One Row Deleted", Toast.LENGTH_LONG).show();
      }
  
  
  }
  Button deletebutton=(Button)findViewById(R.id.button3);
      deletebutton.setOnClickListener(this);
  
  public void onClick(View v) {
      // TODO Auto-generated method stub
      switch (v.getId()) {
      case R.id.button1 :
          gettext();
          break;
      case R.id.button2 :
          Intent i=new      Intent(MyfirstdatabaseActivity.thiViewDetailsActivity.class);
          startActivity(i);
          finish();
      case R.id.button3 :
          deleteRow();
      default:
          break;
      }
  }
  </code></pre>