title: How to return the first row of my SQLite Table in Eclipse
body: <p>I have inserted into my Android Eclipse project an SQLite Table to store some data and I want to return the first row of my SQLite Table.</p>
  
  <p>My database class is DataBaseHandler.java</p>
  
  <pre class="lang-java prettyprint-override"><code>import android.content.ContentValues;
  import android.content.Context;
  import android.database.Cursor;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteOpenHelper;
  import android.util.Log;
  
  
      public class DataBaseHandler extends SQLiteOpenHelper {
  
      // Database Version
      private static final int DATABASE_VERSION = 2;
      // Database Name
      private static final String DATABASE_NAME = "My_SQLite_Database.db";
  
      //constructor for this class
      public DataBaseHandler(Context context) {
          super(context, DATABASE_NAME, null, DATABASE_VERSION);
      }
  
      // Creating the Table when the class is executed    
      @Override
      public void onCreate(SQLiteDatabase db) {
          String CREATE_TABLE = "CREATE TABLE " + "My_SQLite_Database" + "("
                  + "Image_ID" + " TEXT,"
                  + "Image" + " TEXT," + "Title" + " TEXT," + "Info" + " TEXT" + ")";
          db.execSQL(CREATE_TABLE);//executing the create table query
      }
  
      //for inserting data into this table write the following method
        public void addData(String field1, String field2, String field3, String field4) {
          SQLiteDatabase db = this.getWritableDatabase();
  
          ContentValues values = new ContentValues();
          values.put("Image_ID", field1); 
          values.put("Image", field2); 
          values.put("Title", field3); 
          values.put("Info",  field4); 
  
          // Inserting Row
          db.insert("My_SQLite_Database", null, values);
          db.close(); // Closing database connection
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
          // TODO Auto-generated method stub
          Log.w(DataBaseHandler.class.getName(),
                  "Upgrading database from version " + oldVersion + " to "
                      + newVersion + ", which will destroy all old data");
              db.execSQL("DROP TABLE IF EXISTS " + "My_SQLite_Database");
              onCreate(db);
      }
  }
  </code></pre>
  
  <p>In my MainActivity I initialize my SQLite Table(having 4 columns and 4 rows) in my onCreate </p>
  
   <pre class="lang-java prettyprint-override"><code>DataBaseHandler db;
          db = new DataBaseHandler(getApplicationContext());//Your table is created now
  
          db.addData("d1e14b170ff4418693fd0ceb4987adda","string2","string3","string4");
          db.addData("6102a756d92e40d392a4e0ebcb53edb5", "string6", "string7","string8");
          db.addData("9d78a74cf93e479f8e08b47072264b66", "string10", "string11","string12");
          db.addData("482f894ae06746439d86f8e5efa26914", "string14", "string15","string16");
  </code></pre>
  
  <p>Now I want in  onResume of my MainActivity to return the first row of my SQLite Table at a specific point of my code.What should I do?</p>