title: How can I get a cursor from a Content Provider using a database that was created in memory
body: <p><strong>I create a database in memory as follows:</strong></p>
  
  <pre><code>public class DbIoDatabaseHelper extends SQLiteOpenHelper {
  //        public static final String DATABASE_NAME = "DbIo.db";
      public static final String DATABASE_NAME = ":memory:";
      private static final int DATABASE_VERSION = 1;
         public DbIoDatabaseHelper(Context context) {
  //        super(context, DATABASE_NAME, null, DATABASE_VERSION);
          super(context, null, null, DATABASE_VERSION);
          this.myContext = context.getApplicationContext();
      }
   .........
   }
  </code></pre>
  
  <p><strong>In my content provider the query is as follows:</strong></p>
  
  <pre><code> @Override
      public Cursor query(Uri uri, String[] projection, String selection,
                          String[] selectionArgs, String sortOrder) {
          final SQLiteDatabase db = myDb.getReadableDatabase();
          Cursor retCursor;
          switch (sUriMatcher.match(uri)) {
              case LABEL:
                  retCursor = db.query(
                          IOContract.IoEntry.TABLE_NAME,
                          projection,
                          selection,
                          selectionArgs,
                          null,
                          null,
                          sortOrder
                  );
                  break;
  
              default:
                  throw new UnsupportedOperationException("Unknown uri: " + uri);
          }
  </code></pre>
  
  <p><strong>In my activity the cursor is:</strong>  </p>
  
  <pre><code>    Cursor c = contentResolver.query(cpUri, null, selection, argms, null);
  </code></pre>
  
  <p><strong>When I create the database using DATABASE_NAME, the database is created on disk and I get the cursor back.</strong></p>
  
  <pre><code>     public DbIoDatabaseHelper(Context context) {
          super(context, DATABASE_NAME, null, DATABASE_VERSION);
  //        super(context, null, null, DATABASE_VERSION);
          this.myContext = context.getApplicationContext();
      }
  </code></pre>
  
  <p><strong>When I create it in memory using null, I get no element in the cursor - though the cursor returned is not  null .</strong></p>
  
  <pre><code>  public DbIoDatabaseHelper(Context context) {
  //        super(context, DATABASE_NAME, null, DATABASE_VERSION);
          super(context, null, null, DATABASE_VERSION);
          this.myContext = context.getApplicationContext();
      }
  </code></pre>
  
  <p><strong>Is there a way that i can get a valid cursor when the database is created in memory and how can I do it?
       Any help would be greatly appreciated. Thank you.</strong></p>