Skip to content

ToastClickListener

Marc Auberer edited this page Sep 12, 2020 · 4 revisions

Displays a Toast when the associated preference item was clicked.

Usage example

TextPref {
    title = "Toast"
    summary = "Tap to show toast"
    onClick = ToastClickListener(this@MainActivity, "Toast message")
}

or

TextPref {
    title = "Toast"
    summary = "Tap to show toast"
    onClick = ToastClickListener(this@MainActivity, "Toast message", Toast.LENGTH_LONG)
}