- // Declare the class variables.
- private lateinit var editBookmarkListener: EditBookmarkListener
-
- // Declare the class views.
- private lateinit var webpageFavoriteIconRadioButton: RadioButton
- private lateinit var nameEditText: EditText
- private lateinit var urlEditText: EditText
- private lateinit var saveButton: Button
-
- // The public interface is used to send information back to the parent activity.
- interface EditBookmarkListener {
- fun onSaveBookmark(dialogFragment: DialogFragment, selectedBookmarkDatabaseId: Int, favoriteIconBitmap: Bitmap)
- }
-
- override fun onAttach(context: Context) {
- // Run the default commands.
- super.onAttach(context)
-
- // Get a handle for the edit bookmark listener from the launching context.
- editBookmarkListener = context as EditBookmarkListener
- }
-