+ private void prepareFinish() {
+ // Check to see if a snackbar is currently displayed. If so, it must be closed before exiting so that a pending delete is completed before reloading the list view in the bookmarks drawer.
+ if ((bookmarksDeletedSnackbar != null) && bookmarksDeletedSnackbar.isShown()) { // Close the bookmarks deleted snackbar before going home.
+ // Set the close flag.
+ closeActivityAfterDismissingSnackbar = true;
+
+ // Dismiss the snackbar.
+ bookmarksDeletedSnackbar.dismiss();
+ } else { // Go home immediately.
+ // Update the bookmarks folder for the bookmarks drawer in the main WebView activity.
+ MainWebViewActivity.currentBookmarksFolder = currentFolder;
+
+ // Close the bookmarks drawer and reload the bookmarks ListView when returning to the main WebView activity.
+ MainWebViewActivity.restartFromBookmarksActivity = true;
+
+ // Exit the bookmarks activity.
+ finish();
+ }
+ }
+