summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/AddBookmarkPage.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-05-13 11:22:09 -0700
committerJohn Reck <jreck@google.com>2011-05-13 11:22:09 -0700
commit1dd8cd43ff1bf1d7b8ef257b19e761b3eee296a7 (patch)
treea3aa2bae1c564855a9190769ef500499042dd87e /src/com/android/browser/AddBookmarkPage.java
parent6d45e134f2fd61e85b219e3fde7de796961bdd67 (diff)
downloadpackages_apps_Browser-1dd8cd43ff1bf1d7b8ef257b19e761b3eee296a7.zip
packages_apps_Browser-1dd8cd43ff1bf1d7b8ef257b19e761b3eee296a7.tar.gz
packages_apps_Browser-1dd8cd43ff1bf1d7b8ef257b19e761b3eee296a7.tar.bz2
Fix bug where wrong folder contents are loaded
Change-Id: Ie8d6fcf7161bbcdc51462821bbb54653bd6531b0
Diffstat (limited to 'src/com/android/browser/AddBookmarkPage.java')
-rw-r--r--src/com/android/browser/AddBookmarkPage.java17
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!");