In Android Kotlin, when creating a dialog, the samples I've seen include "_, _ ->" what does that mean or do?

The tutorial I’m working on gives this code: private fun showFinalScoreDialog() { MaterialAlertDialogBuilder(requireContext()) .setTitle(getString(R.string.congratulations)) .setMessage(getString(R.string.you_scored, viewModel.score)) .setCancelable(false) .setNegativeButton(getString(R.string.exit)) { _, _ -> exitGame() } .setPositiveButton(getString(R.string.play_again)) { _, _ -> restartGame() } .show() } The tutorial took this moment to explain "trailing lambda syntax", but didn’t bother to explain the actual content of the lambda. The… Read More In Android Kotlin, when creating a dialog, the samples I've seen include "_, _ ->" what does that mean or do?

Android Kotlin AlertDialog.Builder() usage and context. "this" not working

This is my very first time using Kotlin/Android App Development, so I apologise if I am missing something simple. I have a background in Java and C#. I’m trying to display an AlertBox containing X information. All the tutorials I am reading/watching stay that the constructor should be: val builder = AlertDialog.Builder(this) This issue I… Read More Android Kotlin AlertDialog.Builder() usage and context. "this" not working

Android | AlertBuilder Getting String text from values + method

I want to display a text in Alert Dialog from Strings/string.xml and depending on the results within the app, an additional text. string.xml dialog_title = "Hello world" dialog_message = "I am the text from string.xml" my alert dialog alertBuilder .setTitle(R.string.dialog_title) .setMessage(R.string.dialog_message + myClass.getText()) .setCancelable(false) my getText() method public class myClass { public String getText() {… Read More Android | AlertBuilder Getting String text from values + method