mardi 29 septembre 2015

Showing the rest of an SQLite row?

I have printed out a database, but i need to make it clickable to show the rest of that row.

    public String dbToString(){
    String dbString = "";
    SQLiteDatabase db = getWritableDatabase();
    String query = "SELECT * FROM " + TABLE_RECIPES + " WHERE 1;";

    Cursor c = db.rawQuery(query, null);
    c.moveToFirst();

    while(!c.isAfterLast()){
        if (c.getString(c.getColumnIndex("recipeTitle")) != null) {
            dbString += c.getString(c.getColumnIndex("recipeTitle"));
            dbString += "\n";
        }
        c.moveToNext();
    }
    db.close();
    c.close();
    return dbString;
}

I basicly want to make it when the user presses the recipeTitle it will show "recipeIMG", "recipeIngredients" and "recipeProgress"

Aucun commentaire:

Enregistrer un commentaire