title: cannot resolve symbol 'context' when Accessing database from multiple activities using Singleton
body: <p>I've been attempting to implement the use of a database in my application using a tutorial on YouTube:  <a href="https://www.youtube.com/watch?v=T0ClYrJukPA" rel="nofollow noreferrer">https://www.youtube.com/watch?v=T0ClYrJukPA</a>.  </p>
  
  <p>But ran into the problem of trying to access my database from multiple activities.  A question on Stack:  <a href="https://stackoverflow.com/questions/19478271/how-to-pass-database-objects-between-activities-android">How to pass database objects between activities (Android)</a></p>
  
  <p>Led me to this:  <a href="http://www.androiddesignpatterns.com/2012/05/correctly-managing-your-sqlite-database.html" rel="nofollow noreferrer">http://www.androiddesignpatterns.com/2012/05/correctly-managing-your-sqlite-database.html</a> which seems like it will work correctly except for the error "cannot resolve symbol 'context'" in the main activity I'm trying to use the database in.  Any help would be greatly appreciated.  </p>
  
  <p>My main activity:  </p>
  
  <pre><code>import android.content.Context;
  import android.content.Intent;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.Spinner;
  
  public class Home extends AppCompatActivity {
      DatabaseHelper myDb;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_home);
         //create database
  
          myDb = DatabaseHelper.getInstance(context);
  </code></pre>
  
  <p>my DatabaseHelper:  </p>
  
  <pre><code>import android.content.ContentValues;
  import android.content.Context;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteOpenHelper;
  
  
  public class DatabaseHelper extends SQLiteOpenHelper {
  
      private static DatabaseHelper sInstance;
  
      public static final String DATABASE_NAME = "character_info.db";
      public static final String TABLE_NAME = "characters_table";
      public static final String COL_1 = "NAME";
      public static final String COL_3 = "HEALTH";
      public static final String COL_2 = "STRENGTH";
      public static final String COL_4 = "ENDURANCE";
      public static final String COL_5 = "CARRY_WEIGHT";
      public static final String COL_6 = "AGILITY";
      public static final String COL_7 = "INTELLIGENCE";
      public static final String COL_8 = "CHARISMA";
      public static final String COL_9 = "ZPREP";
      public static final String COL_10 = "INVENTORY";
  
      public static synchronized DatabaseHelper getInstance(Context context) {
  
          if (sInstance == null) {
              sInstance = new DatabaseHelper(context.getApplicationContext());
          }
          return sInstance;
      }
  
      private DatabaseHelper(Context context) {
          super(context, DATABASE_NAME, null, 1);
  
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
          String SQL_String = "create table " + TABLE_NAME +" (NAME TEXT PRIMARY KEY, HEALTH TEXT, STRENGTH TEXT" +
                  ", ENDURANCE TEXT, CARRY_WEIGHT TEXT, AGILITY TEXT, INTELLIGENCE TEXT, CHARISMA TEXT, ZPREP TEXT, INVENTORY TEXT)";
  
          db.execSQL(SQL_String);
  
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
          db.execSQL("DROP TABLE IF EXISTS "+TABLE_NAME);
          onCreate(db);
      }
  
      public boolean insertData(String name, String health, String strength, String endurance, String carryweight,
                                String agility, String intelligence, String charisma, String zprep, String inventory) {
          SQLiteDatabase db = this.getWritableDatabase();
          ContentValues contentValues = new ContentValues();
          contentValues.put(COL_1, name);
          contentValues.put(COL_2, health);
          contentValues.put(COL_3, strength);
          contentValues.put(COL_4, endurance);
          contentValues.put(COL_5, carryweight);
          contentValues.put(COL_6, agility);
          contentValues.put(COL_7, intelligence);
          contentValues.put(COL_8, charisma);
          contentValues.put(COL_9, zprep);
          contentValues.put(COL_10, inventory);
          long result = db.insert(TABLE_NAME, null, contentValues);
  
          if (result == -1)
              return false;
          else
              return true;
  
      }
  }
  </code></pre>