How to delete a Row from the DB in android
<p>I'm new to android ... i have developed a Database application , were i'm able to insert the textfield details , but i want to delete the specific row , i need to search by name and delete the user.</p>

<p>can someone help me on this :</p>

<p>My DB code is:</p>

<pre><code>public void deleteRow(String firstname)
{

    try {db.delete(TABLE_NAME,TABLE_ROW_ONE + "=?" + new String[]{firstname},null);}
    catch (Exception e)
    {
        Log.e("DB ERROR", e.toString());
        e.printStackTrace();
    }
}
</code></pre>

<p>Activty code is :</p>

<p>deleteButton.setOnClickListener
        (
            new View.OnClickListener()
            {
                @Override public void onClick(View v) {deleteRow();}
            }
        );</p>

<p>private void deleteRow()
    {
        try
        {</p>

<pre><code>        db.deleteRow(textFieldOne.getText().toString());


        updateTable();


        emptyFormFields();
    }
    catch (Exception e)
    {
        Log.e("Delete Error", e.toString());
        e.printStackTrace();
    }
}
</code></pre>

<p>textFieldOne is the first name of the user.</p>

<p>can someone help me on this .. </p>
