Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. //Adding new contact
  2. public void addShoppingItem(ShoppingItem shoppingItem){
  3. SQLiteDatabase db = this.getWritableDatabase();
  4.  
  5. ContentValues values = new ContentValues();
  6. values.put(KEY_NAME, shoppingItem.getName()); //item name
  7.  
  8. //Inserting Row
  9. db.insert(TABLE_SHOPPING, null, values);
  10. db.close(); //Closing database connection
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement