Here is my code:
public class DBHelper extends SQLiteOpenHelper {
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("sql-query");
try {
//db = getWritableDatabase();
fillAllDB(db);
} catch (JSONException e) {
e.printStackTrace();
}
}
// some code
}
fillAllDB(db);
method adds a record to the table, but I can't use db = getWritableDatabase();
before method call - this is causing the looping. What to do in this case?