Skip to content

Commit

Permalink
Added screenshot and removed some left code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheesebaron committed Nov 2, 2011
1 parent badeeeb commit 51170c7
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 12 deletions.
1 change: 1 addition & 0 deletions ContentProvider/ContentProviderActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ void InsertValues()
{
ContentValues values = new ContentValues();

// Don't set _ID if you want to auto increment it.
//values.Put(LocationContentProvider._ID, 1);
values.Put(LocationContentProvider.NAME, "Brüel & Kjær");
values.Put(LocationContentProvider.LATITUTDE, 55.816932);
Expand Down
12 changes: 0 additions & 12 deletions ContentProvider/LocationContentProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,10 @@ public override Android.Net.Uri Insert(Android.Net.Uri uri, ContentValues initia
}

// Make sure all NOT NULL fields are set
if (values.ContainsKey(_ID) == false)
{
throw new SQLException("Failed to insert row into " + uri + ". Query is missing _ID!");
}
if (values.ContainsKey(NAME) == false)
{
throw new SQLException("Failed to insert row into " + uri + ". Query is missing NAME!");
}
if (values.ContainsKey(LONGITUDE) == false)
{
throw new SQLException("Failed to insert row into " + uri + ". Query is missing LONGITUDE!");
}
if (values.ContainsKey(LATITUTDE) == false)
{
throw new SQLException("Failed to insert row into " + uri + ". Query is missing LATITUTDE!");
}

SQLiteDatabase db = dbHelper.WritableDatabase;
long rowId = db.Insert(DATABASE_TABLE_NAME, NAME, values);
Expand Down
File renamed without changes.
Binary file added ContentProvider/Screenshots/Output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 51170c7

Please sign in to comment.