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? -

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

ajax - PHP/JSON Login script (Twitter style) not setting sessions -