Answers for "can't toast on a thread that has not called looper.prepare()"

0

can't toast on a thread that has not called looper.prepare()

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()
        }
    }
Posted by: Guest on September-22-2021

Code answers related to "can't toast on a thread that has not called looper.prepare()"

Browse Popular Code Answers by Language