title: android - sqlite getReadableDatabase() error
body: <p>I am a beginner and I want to use SQLITE but I got error.
  this function is inside the main class:</p>
  
  <pre><code>public Cursor getData(int id) {
      SQLiteDatabase db = this.getReadableDatabase();
      Cursor res =  db.rawQuery( "select * from weight where id="+id+"", null );
      return res;
   }
  </code></pre>
  
  <p>I imported the sqlite files:</p>
  
  <pre><code>import android.database.Cursor;
  import android.database.DatabaseUtils;
  import android.database.sqlite.SQLiteOpenHelper;
  import android.database.sqlite.SQLiteDatabase;
  </code></pre>
  
  <p>the errror is:
  The method getReadableDatabase() is undefined for the type Activity3    </p>
  
  <p>please help</p>