title: Why onCreate() function is not call by the constructor
body: <p>I'm a newbie in java and android studio. I'm trying to code a to do list application. To achieve this, I need to store user's task in a database base. For this I follow this tutorial:</p>
  
  <p>[<a href="https://www.sitepoint.com/starting-android-development-creating-todo-app/][1]" rel="nofollow noreferrer">https://www.sitepoint.com/starting-android-development-creating-todo-app/][1]</a></p>
  
  <p>And more precisely the following code for create the database:</p>
  
  <pre><code>package com.aziflaj.todolist.db;
  
  import android.content.Context;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteOpenHelper;
  
  public class TaskDbHelper extends SQLiteOpenHelper {
  
      public TaskDbHelper(Context context) {
          super(context, TaskContract.DB_NAME, null, TaskContract.DB_VERSION);
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
          String createTable = "CREATE TABLE " + TaskContract.TaskEntry.TABLE + " ( " +
                  TaskContract.TaskEntry._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                  TaskContract.TaskEntry.COL_TASK_TITLE + " TEXT NOT NULL);";
  
          db.execSQL(createTable);
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
          db.execSQL("DROP TABLE IF EXISTS " + TaskContract.TaskEntry.TABLE);
          onCreate(db);
      }
  }
  </code></pre>
  
  <p>I modified it like</p>
  
  <pre><code>package com.example.steven.myapplication;
  import android.content.ContentValues;
  import android.content.Context;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteOpenHelper;
  import android.util.Log;
  
  public class DatabaseHandler extends SQLiteOpenHelper {
  
      private static final String TAG = "DatabaseHandler";
      private static final String DATABASE_NAME = "taskRegister";
      private static final String TASK_TABLE= "task";
      private static final String COLUMN_ID = "id";
      private static final String COLUMN_TASK = "task";
      private static final String COLUMN_STATE = "false";
  
      public DatabaseHandler(Context context) {
          super(context, "taskRegister", null, 1);
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
          String database_table = "CREATE TABLE task (" +
                  "id int INTEGER PRIMARY " +
                  "task TEXT" +
                  "state TEXT )";
          db.execSQL(database_table);
          Log.d(TAG, "===Inside onCreate from DatabaseHandler===");
      }
  </code></pre>
  
  <p>I voluntarily remove any line in order to avoid you to have to read too many code. :)</p>
  
  <p>Does anyone can help to understand why the onCreate() function isn't call by the constructor in order to initialize my database ?</p>
  
  <p>I call my constructor from another class like:</p>
  
  <pre><code>DatabaseHandler test = new DatabaseHandler(get.Application());
  </code></pre>
  
  <p>Thanks</p>