2

How can we drop a database in android?

1
  • Try this. Commented Mar 8, 2011 at 11:03

2 Answers 2

2

This should work:

private SQLiteDatabase db;
private static final String TABLE_NAME = "name_of_table";

try {
  db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
  db.execSQL("VACUUM");
} catch (SQLException sqle) {....}
Sign up to request clarification or add additional context in comments.

Comments

2

This is going to be a very late reply to this post, but if anyone else is facing the same issue, can try the following.

myContext.deleteDatabase(DB_NAME);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.