'kotlin - required context, found AnkoAsyncContext

SOLVED

I'm trying to use this inside doAsync from org.jetbrains.anko:anko-commons:0.10.8 but it's not letting me.

Snippet of my code:

doAsync {
    buttonNext.setOnClickListener {
        if (editTextInput.text.isEmpty()) {
            val alert = AlertDialog.Builder(this)
            alert.setTitle("You forgot something")
            alert.setMessage("Answer cannot be empty!")
            alert.show()
        }
    }
    ...
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source