Created
April 22, 2017 09:32
-
-
Save markojerkic/3c770849264a80a5d6e4c8d6fd262d05 to your computer and use it in GitHub Desktop.
Create of CRUD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void put(DatabaseHelper mDbHelper, String value1, String value2) { | |
// Gets the database in write mode | |
SQLiteDatabase db = mDbHelper.getWritableDatabase(); | |
//Content values store the date you want to put into the database | |
//Content values connect the value with the column | |
ContentValues values = new ContentValues(); | |
values.put(FeedEntry.COLUMN_NAME1, value1); | |
values.put(FeedEntry.COLUMN_NAME1, value2); | |
// Insert the new row, returning the primary key value of the new row | |
long newRowId = db.insert(FeedEntry.TABLE_NAME, null, values); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment