Java.Lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
Code
Toast toast = Toast.makeText(mContext, "Something", ToastLength.LENGTH_SHORT);
ExceptionJava.Lang.RuntimeException: Can't create handler inside thread
that has not called Looper.prepare()
ReasonAndroid basically works on two thread types namely UI thread and background thread.
Toast cannot be called from a non-UI thread.
SolutionRunOnUiThread(() => { Toast.MakeText(this, "Something", ToastLength.Short).Show(); });
Comments
Post a Comment