-class CreateBookmarkDialog: DialogFragment() {
- // The public interface is used to send information back to the parent activity.
- interface CreateBookmarkListener {
- fun onCreateBookmark(dialogFragment: DialogFragment, favoriteIconBitmap: Bitmap)
- }
-
- // The create bookmark listener is initialized in `onAttach()` and used in `onCreateDialog()`.
- private lateinit var createBookmarkListener: CreateBookmarkListener
-
- override fun onAttach(context: Context) {
- // Run the default commands.
- super.onAttach(context)
-
- // Get a handle for the create bookmark listener from the launching context.
- createBookmarkListener = context as CreateBookmarkListener
- }
+// Define the class constants.
+private const val URL_STRING = "url_string"
+private const val TITLE = "title"
+private const val FAVORITE_ICON_BYTE_ARRAY = "favorite_icon_byte_array"