- // Get a handle for `EditFolderListener` from `parentActivity`.
- try {
- editBookmarkFolderListener = (EditBookmarkFolderListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement EditBookmarkFolderListener.");
- }
+ // Get a handle for `EditFolderListener` from the launching context.
+ editBookmarkFolderListener = (EditBookmarkFolderListener) context;
+ }
+
+ // Store the database ID in the arguments bundle.
+ public static EditBookmarkFolderDialog folderDatabaseId(int databaseId) {
+ // Create a bundle
+ Bundle bundle = new Bundle();
+
+ // Store the folder database ID in the bundle.
+ bundle.putInt("Database ID", databaseId);
+
+ // Add the bundle to the dialog.
+ EditBookmarkFolderDialog editBookmarkFolderDialog = new EditBookmarkFolderDialog();
+ editBookmarkFolderDialog.setArguments(bundle);
+
+ // Return the new dialog.
+ return editBookmarkFolderDialog;