diff options
-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!"); |