title: SQLite - getDatabase called recursively
body: <p>Here is my code:</p>
  
  <pre><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
  }
  </code></pre>
  
  <p><code>fillAllDB(db);</code> method adds a record to the table, but I can't use <code>db = getWritableDatabase();</code> before method call - this is causing the looping. What to do in this case?</p>