Juro
Juro

Reputation: 129

android Dialog Dismiss -> Only the original thread that created a view hierarchy can touch its views. when I using runOnUiThread

I am dismiss Dialog through RunOnUiThread. However, the error message is as follows. "Only the original thread that created a view hierarchy can touch its views." Can I know what to do?

This is my code

appleLoginDialog?.let { dialog ->
            runOnUiThread {
                if (dialog.isShowing) {
                    dialog.dismiss()
                }
            }
        }

Upvotes: 0

Views: 86

Answers (0)

Related Questions