In my application listview is available and in each row add button and show button available, whenever add button clicked the data is stored sqlite database.After show button clicked navigate the another activity in that all data displayed which is available in database. And in that activity delete button is available,whenever delete button is clicked delete the record from the database at the same time navigate the activity to previous activity and display remaining records in that activity.And my question is how to navigate activity after delete the record from the database. This is my onclick listener if(v.equals(btnAddBeer)){
if(addCheck==true){
if(helper.getBeerid(strBeerId).getCount()>0)
{
// Toast.makeText(MyBeersActivity.this, "Already added", Toast.LENGTH_SHORT).show(); } else{
db = helper.getWritableDatabase();
helper.insert(strBeerId,strBeerName,strBeerId,db);
btnAddBeer.setBackgroundResource(R.drawable.deletebeer_reviews);
Toast.makeText(MyBeersReviewsActivity.this, "Successfully added", Toast.LENGTH_SHORT).show();
addCheck=false;
}
}
else{
helper.deleteRecord(strBeerId);
Log.e("delete.....","successfully");
new AlertDialog.Builder(getParent())
.setTitle("Message")
.setMessage(strBeerName+" is deleted successfully")
.setPositiveButton(DataUrls.dialogbutton, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int whichButton)
{
MyBeersTabActivity.group.onBackPressed();
}
}).show();
}
}
- List item