title: Why can't I use Resources.getSystem() without a Runtime error?
body: <pre><code>public class BobDatabase extends SQLiteOpenHelper{
  private static final String DATABASE_NAME = "bob.db";
  private static final int DATABASE_VERSION = 1;
  public static final String DEFAULT_PROFILE = "default_profile";
  
  public BobDatabase(Context context) 
  {
      super(context, DATABASE_NAME, null, DATABASE_VERSION);
  }
  
  @Override
  public void onCreate(SQLiteDatabase database) 
  {
      createProfileTable(database);
      createTimeTable(database);
      createEventTable(database);
      createLocationTable(database);
  }
  
  /**
   * Creates a table for Profile objects, executes the string create_profile_table_sql
   * contained within strings.xml
   * @param database
   */
  public void createProfileTable(SQLiteDatabase database)
  {
      database.execSQL(Resources.getSystem().getString(R.string.create_profile_table_sql));
  }}
  </code></pre>
  
  <p>I get this error</p>
  
  <p><strong>01-14 12:20:57.591: E/AndroidRuntime(1825): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x7f040003</strong></p>
  
  <p>The code that causes the error is the single line inside createProfileTable specifically, <strong>Resources.getSystem().getString(R.string.create_profile_table_sql)</strong> if I use a class variable to hold a Context and do <strong>context.getString(R.string.create_profile_table_sql)</strong> I don't get any errors but I don't want to do that because I want to avoid memory leaks and according to what I know this should work.  Any idea what's happening?</p>