]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java
Populate and save the domain `Switches` and `Spinners`.
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / activities / BookmarksActivity.java
index b6f9bc617c1902ae8f069ceb42d587bd7fd8792f..dcb603ff715678d25e6c5511ebe4ad3397804baa 100644 (file)
@@ -505,32 +505,27 @@ public class BookmarksActivity extends AppCompatActivity implements CreateBookma
 
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
 
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
-        //Inflate the menu.
+        // Inflate the menu.
         getMenuInflater().inflate(R.menu.bookmarks_options_menu, menu);
 
         getMenuInflater().inflate(R.menu.bookmarks_options_menu, menu);
 
-        return true;
-    }
-
-    @Override
-    public boolean onPrepareOptionsMenu(Menu menu) {
-        super.onPrepareOptionsMenu(menu);
-
+        // Success.
         return true;
     }
 
     @Override
     public boolean onOptionsItemSelected(MenuItem menuItem) {
         return true;
     }
 
     @Override
     public boolean onOptionsItemSelected(MenuItem menuItem) {
+        // Get the ID of the `MenuItem` that was selected.
         int menuItemId = menuItem.getItemId();
 
         switch (menuItemId) {
         int menuItemId = menuItem.getItemId();
 
         switch (menuItemId) {
-            case android.R.id.home:
+            case android.R.id.home:  // The home arrow is identified as `android.R.id.home`, not just `R.id.home`.
                 if (currentFolder.isEmpty()) {  // Exit BookmarksActivity if currently in the home folder.
                     NavUtils.navigateUpFromSameTask(this);
                 } else {  // Navigate up one folder.
                     // Place the former parent folder in `currentFolder`.
                     currentFolder = bookmarksDatabaseHelper.getParentFolder(currentFolder);
 
                 if (currentFolder.isEmpty()) {  // Exit BookmarksActivity if currently in the home folder.
                     NavUtils.navigateUpFromSameTask(this);
                 } else {  // Navigate up one folder.
                     // Place the former parent folder in `currentFolder`.
                     currentFolder = bookmarksDatabaseHelper.getParentFolder(currentFolder);
 
-                    // Exit BookmarksActivity if currently in the home folder.
+                    // Update `bookmarksListView`.
                     updateBookmarksListView(currentFolder);
                 }
                 break;
                     updateBookmarksListView(currentFolder);
                 }
                 break;