diff options
author | John Reck <jreck@google.com> | 2011-05-13 12:45:32 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-05-13 12:45:32 -0700 |
commit | d95270ce5d17d0dae87cca3fc7a6b04161847fc7 (patch) | |
tree | 57233562c7712fac9d1025d3d9cf2992a9162897 | |
parent | 006ae18b7b0f3e5d8b6ce80a5cac365ee9b226fd (diff) | |
parent | 1dd8cd43ff1bf1d7b8ef257b19e761b3eee296a7 (diff) | |
download | packages_apps_browser-d95270ce5d17d0dae87cca3fc7a6b04161847fc7.zip packages_apps_browser-d95270ce5d17d0dae87cca3fc7a6b04161847fc7.tar.gz packages_apps_browser-d95270ce5d17d0dae87cca3fc7a6b04161847fc7.tar.bz2 |
Merge "Fix bug where wrong folder contents are loaded"
-rw-r--r-- | src/com/android/browser/AddBookmarkPage.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java index 3524c22..18667f3 100644 --- a/src/com/android/browser/AddBookmarkPage.java +++ b/src/com/android/browser/AddBookmarkPage.java @@ -455,15 +455,24 @@ public class AddBookmarkPage extends Activity BrowserContract.Bookmarks.IS_FOLDER }; String where = BrowserContract.Bookmarks.IS_FOLDER + " != 0"; + String whereArgs[] = null; if (mEditingFolder) { - where += " AND " + BrowserContract.Bookmarks._ID + " != " - + mMap.getLong(BrowserContract.Bookmarks._ID); + where += " AND " + BrowserContract.Bookmarks._ID + " != ?"; + whereArgs = new String[] { Long.toString(mMap.getLong( + BrowserContract.Bookmarks._ID)) }; + } + long currentFolder; + Object data = mCrumbs.getTopData(); + if (data != null) { + currentFolder = ((Folder) data).Id; + } else { + currentFolder = mRootFolder; } return new CursorLoader(this, - getUriForFolder(mCurrentFolder), + getUriForFolder(currentFolder), projection, where, - null, + whereArgs, BrowserContract.Bookmarks._ID + " ASC"); default: throw new AssertionError("Asking for nonexistant loader!"); |