onDestroy

protected open override fun onDestroy()

Called when the activity is being destroyed.

Ensures that any pending permission result is marked as denied if the activity is destroyed without a proper result (e.g., user backs out of permission dialog).