java - Database clear each time my application runs -


does know how reset database everytime application executes in real device ?

i have code not work...

public void dodbcheck()     {         try{                 file file = new file(context.getexternalfilesdir(null).getabsolutepath());                 file.delete();         }catch(exception ex)         {             }         } 

any solutions ?

public void cleardatabase() { sqlitedatabase db = helper.getwritabledatabase(); db.delete({tablename},null,null) // write line each table in db. } 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -