toolkit / com.sas.android.visualanalytics.report.controller / ReportViewController / addReportEventListener

addReportEventListener

fun addReportEventListener(onReportEvent: (event: ReportEvent) -> Unit): Unit

Adds a callback to be notified of various events and requests from this ReportViewController so that an enclosing Activity can appropriately handle requests or react to events. An enclosing Activity might implement a listener like this:

    addReportEventListener { reportEvent ->
        when (reportEvent) {
            is ReportError -> {
                if(reportEvent.fatalError) {
                    finish()
                }
            }
        }
    }

Parameters

onReportEvent -

    a function called when a reportEvent is triggered by this ReportViewController

Copyright © 2018 by SAS Institute Inc., Cary, NC, USA. All Rights Reserved.