diff options
author | Leon Scroggins <scroggo@google.com> | 2009-05-08 13:54:52 -0400 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2009-05-08 13:54:52 -0400 |
commit | fce182bff7713a12714018327f6da9500011ab17 (patch) | |
tree | 94bc6f355804b05c21a2853e78ae74199bb01dee /src/com/android | |
parent | 4c5cea0286f5b8be8c1b2d61444f0539ffb58511 (diff) | |
download | packages_apps_Browser-fce182bff7713a12714018327f6da9500011ab17.zip packages_apps_Browser-fce182bff7713a12714018327f6da9500011ab17.tar.gz packages_apps_Browser-fce182bff7713a12714018327f6da9500011ab17.tar.bz2 |
Avoid using a deprecated method.
The Cursor method commitUpdates has been deprecated, in favor
of using ContentResolver.update. Eliminate this call of
commitUpdates.
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index ebfc30e..af65072 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -3397,6 +3397,8 @@ public class BrowserActivity extends Activity url.length() >= SQLiteDatabase.SQLITE_MAX_LIKE_PATTERN_LENGTH) { return; } + // See if we can find the current url in our history database and + // add the new title to it. if (url.startsWith("http://www.")) { url = url.substring(11); } else if (url.startsWith("http://")) { @@ -3411,15 +3413,12 @@ public class BrowserActivity extends Activity Cursor c = mResolver.query(Browser.BOOKMARKS_URI, Browser.HISTORY_PROJECTION, where, selArgs, null); if (c.moveToFirst()) { - if (LOGV_ENABLED) { - Log.v(LOGTAG, "updating cursor"); - } // Current implementation of database only has one entry per // url. - int titleIndex = - c.getColumnIndex(Browser.BookmarkColumns.TITLE); - c.updateString(titleIndex, title); - c.commitUpdates(); + ContentValues map = new ContentValues(); + map.put(Browser.BookmarkColumns.TITLE, title); + mResolver.update(Browser.BOOKMARKS_URI, map, + "_id = " + c.getInt(0), null); } c.close(); } catch (IllegalStateException e) { |