Want to access Activity.this in Kotlin? You can get a reference to your MainActivity object in Kotlin by using a qualified this. e.g.:
1 2 3 | class MyActivity : MainActivity() { val builder = MaterialDialog.Builder(this@MyActivity) } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.