📜  无法在未调用 looper.prepare() 的线程上敬酒 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:58.885000             🧑  作者: Mango

代码示例1
inner class yourThread : Thread() {
        override fun run() {
        // this is for fragment, you can use 'this' for Activity
            requireActivity().runOnUiThread { 
           // Your Toast
                 Toast.makeText(requireContext(), "Toasted", Toast.LENGTH_LONG).show()
        }
    }