Code example for SQLiteCursor

Methods: moveToFirstgetStringclosegetColumnIndex

0
            db = this.openOrCreateDatabase("/data/data/info.hagedev.itscool/databases/timetable", SQLiteDatabase.OPEN_READWRITE, null);
         } 
 
        q = "SELECT TimetableURL FROM Routes WHERE Departure = '"+dept+"' AND Arrival ='"+arvl+"';";
        cursor = (SQLiteCursor)db.rawQuery(q, null);
        if(cursor.moveToFirst()){
        		url = cursor.getString(cursor.getColumnIndex("TimetableURL"));
        } 
        db.close();
        cursor.close();
 
        Log.d("query",q);
        Log.d("departure",dept);
        Log.d("arrival", arvl);
        Log.d("url", url);
 
 
        intent.putExtra("departure", dept);
        intent.putExtra("arrival", arvl);
        intent.putExtra("url", url);
Contextual code suggestions in your IDE  Get Codota for Java