Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I want to clear my SQLite database by deleting the associated db file and then recreating it.
However, I can't use context.deleteDatabase() for I'm working with the min API 10.
context.deleteDatabase()
Any alternatives?
deleteDatabase()
Context.deleteDatabase( String )
this.deleteDatabase( String )
Context
SQLiteDatabase db = helper.getWritableDatabase(); //helper is object extends SQLiteOpenHelper db.delete(DatabaseHelper.TAB_USERS, null, null); db.delete(DatabaseHelper.TAB_USERS_GROUP, null, null);
Add a comment
Required, but never shown
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.
Explore related questions
See similar questions with these tags.
deleteDatabase()has been around since API 1. Are you usingContext.deleteDatabase( String )-- a static call --, orthis.deleteDatabase( String )?deleteDatabase()is not static.deleteDatabase()onContext. Post your code.