- // Define the class variables.
- private lateinit var viewRequestListener: ViewRequestListener
-
- // The public interface is used to send information back to the parent activity.
- interface ViewRequestListener {
- // Show the previous request.
- fun onPrevious(currentId: Int)
-
- // Show the next request.
- fun onNext(currentId: Int)
- }
-
- override fun onAttach(context: Context) {
- // Run the default commands.
- super.onAttach(context)
-
- // Get a handle for the listener from the launching context.
- viewRequestListener = context as ViewRequestListener
- }
-