Skip to content

Instantly share code, notes, and snippets.

@KingIdee
Created August 1, 2017 02:06
Show Gist options
  • Save KingIdee/75538a8fb89aae807d190197e72f3305 to your computer and use it in GitHub Desktop.
Save KingIdee/75538a8fb89aae807d190197e72f3305 to your computer and use it in GitHub Desktop.
public class Food {
public static Meal getMeal(String name){
FoodDb foodDb = new FoodDb();
row = foodDb.getMeal(name);
return new Meal(row);
}
}
class FoodDb {
public Cursor getMeal(String name) {
db = helper.getWriteableDatabase();
return db.rawQuery("SELECT * FROM meals WHERE name=?", new String[]{name});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment