Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
Adds usage example in the demo module.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Catinean committed Jun 2, 2015
1 parent 3a33e0d commit 6152aa6
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -8,6 +8,7 @@

public class DatabaseWriter {

private static final String KEY_ALLOW_YIELD = "allowYield";
private final ContentResolver contentResolver;

public DatabaseWriter(ContentResolver contentResolver) {
Expand All @@ -23,10 +24,14 @@ public void bulkSaveDataToFireworksTable(ContentValues[] values) {
}

private void bulkSaveDataToTable(String table, ContentValues[] values) {
Uri uri = createUri(table);
Uri uri = createUriWithoutYieldFor(table);
contentResolver.bulkInsert(uri, values);
}

private Uri createUriWithoutYieldFor(String table) {
return createUri(table).buildUpon().appendQueryParameter(KEY_ALLOW_YIELD, "false").build();
}

private void saveDataToTable(String table, ContentValues values) {
Uri uri = createUri(table);
contentResolver.insert(uri, values);
Expand Down

0 comments on commit 6152aa6

Please sign in to comment.