i have created a database in my android app:
Context context = this.getApplicationContext();
SQLiteDatabase db;
String path = "cul开发者_开发知识库tura.db";
db = context.openOrCreateDatabase(path, Context.MODE_WORLD_WRITEABLE, null);
ok if my app is killed by task manager or the phone is restarted the database is empty. does anyone have a solution????
The code to create a database is as follows :
SQLiteDatabase sampleDB = null;
sampleDB = this.openOrCreateDatabase(Constants.DB_NAME, MODE_PRIVATE, null);
The database shouldn't be empty even if the phone is restarted.
Did you properly created the tables & inserted the values ?
精彩评论