diff options
| author | Tom O'Neill <tomo@google.com> | 2009-12-15 11:27:15 -0800 |
|---|---|---|
| committer | Tom O'Neill <tomo@google.com> | 2009-12-16 09:54:24 -0800 |
| commit | 77560fc704f2933e0df8a4be0768b2439a0bab2a (patch) | |
| tree | b42a79fbe8648db3bca5c2f1c0dd19c4670262ba /tutorials/NotepadCodeLab/Notepadv2/src | |
| parent | 7a416277107f8ae46831fe8c5501f7e618a37f3e (diff) | |
Finish adding Makefiles for the Notepad tutorial.
Add the missing makefiles for the non-solution versions of the tutorial
code. Required providing missing imports in Notepadv2. Also standardized
white spaces using Source > Correct Indentation in Eclipse and a few
manual changes. This was done to minimize differences such as:
diff -r Notepadv1 Notepadv1Solution
diff -r Notepadv1Solution/src/com/android/demo/notepad1/ Notepadv2/src/com/android/demo/notepad2/
Change-Id: Ie8b10efd61f2200b3c741ea500a6924710ab54ed
Diffstat (limited to 'tutorials/NotepadCodeLab/Notepadv2/src')
| -rwxr-xr-x | tutorials/NotepadCodeLab/Notepadv2/src/com/android/demo/notepad2/Notepadv2.java | 2 | ||||
| -rwxr-xr-x | tutorials/NotepadCodeLab/Notepadv2/src/com/android/demo/notepad2/NotesDbAdapter.java | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/tutorials/NotepadCodeLab/Notepadv2/src/com/android/demo/notepad2/Notepadv2.java b/tutorials/NotepadCodeLab/Notepadv2/src/com/android/demo/notepad2/Notepadv2.java index abfc53864..c038180c9 100755 --- a/tutorials/NotepadCodeLab/Notepadv2/src/com/android/demo/notepad2/Notepadv2.java +++ b/tutorials/NotepadCodeLab/Notepadv2/src/com/android/demo/notepad2/Notepadv2.java @@ -20,9 +20,11 @@ import android.app.ListActivity; import android.content.Intent; import android.database.Cursor; import android.os.Bundle; +import android.view.ContextMenu; import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.view.ContextMenu.ContextMenuInfo; import android.widget.ListView; import android.widget.SimpleCursorAdapter; diff --git a/tutorials/NotepadCodeLab/Notepadv2/src/com/android/demo/notepad2/NotesDbAdapter.java b/tutorials/NotepadCodeLab/Notepadv2/src/com/android/demo/notepad2/NotesDbAdapter.java index 5bf51b1e5..50994ae43 100755 --- a/tutorials/NotepadCodeLab/Notepadv2/src/com/android/demo/notepad2/NotesDbAdapter.java +++ b/tutorials/NotepadCodeLab/Notepadv2/src/com/android/demo/notepad2/NotesDbAdapter.java @@ -43,13 +43,13 @@ public class NotesDbAdapter { private static final String TAG = "NotesDbAdapter"; private DatabaseHelper mDbHelper; private SQLiteDatabase mDb; - + /** * Database creation sql statement */ private static final String DATABASE_CREATE = - "create table notes (_id integer primary key autoincrement, " - + "title text not null, body text not null);"; + "create table notes (_id integer primary key autoincrement, " + + "title text not null, body text not null);"; private static final String DATABASE_NAME = "data"; private static final String DATABASE_TABLE = "notes"; @@ -102,7 +102,7 @@ public class NotesDbAdapter { mDb = mDbHelper.getWritableDatabase(); return this; } - + public void close() { mDbHelper.close(); } @@ -158,9 +158,9 @@ public class NotesDbAdapter { Cursor mCursor = - mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, - KEY_TITLE, KEY_BODY}, KEY_ROWID + "=" + rowId, null, - null, null, null, null); + mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, + KEY_TITLE, KEY_BODY}, KEY_ROWID + "=" + rowId, null, + null, null, null, null); if (mCursor != null) { mCursor.moveToFirst(); } |
