title: Passing Context to SQLiteOpenHelper
body: <p>First up, I am new to android apps and am not working solo on this. My team mate has taken design while I handle this, and asked me to set up the database and the method to do this, etc etc.</p>
  
  <p>So while most of this seems to be ok, I put:</p>
  
  <pre><code>Context context = null;
  DataBaseHelper drinksDataBase = new DataBaseHelper(context); 
  </code></pre>
  
  <p>into his main activity.</p>
  
  <p>The constructer is as follows:</p>
  
  <pre><code>public DataBaseHelper(Context  context) {
  
      super(context, DB_NAME, null, 1);
      this.myContext = context;
      try{
          createDataBase();
      }
      catch(IOException e){
  
      }
  }
  </code></pre>
  
  <p>Ignoring the null, which I am assuming is the current cause of the app crashing, how would I go about getting the proper context for the app so that I can make my database work?</p>
  
  <p>It actually seems to be crashing on <code>this.getReadableDatabase()</code> so whether that is the null context or not, I don't know.</p>
  
  <p>Logcat is failing to launch due to:</p>
  
  <pre><code>[2012-10-12 10:37:57 - Unexpected error while launching logcat. Try reselecting the device.] device not found
  com.android.ddmlib.AdbCommandRejectedException: device not found
      at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:752)
      at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373)
      at com.android.ddmlib.Device.executeShellCommand(Device.java:462)
      at com.android.ddmuilib.logcat.LogCatReceiver$1.run(LogCatReceiver.java:109)
      at java.lang.Thread.run(Unknown Source)  
  </code></pre>
  
  <p>Thanks in advance,</p>
  
  <p>James</p>