runtime - Alertdialog does not work, it make exception in Android -
I try to execute the following code but it is causing problems without code works fine without a dialog box Pop up and want to ask the user to enable its locked WiFi. The progressive code throws the same error within the log history and comment lines here! Use You are calling it from a worker thread to toast you from within the main thread Make text () or call the alert dialog. You can also use a handler.
11: 46: 57.306: E / AndroidRuntime (2140): Fatal exception: Thread-141 11: 46: 57.306: E / Android Random (2140): java.lang.RuntimeException: The header can not be made inside the thread which is not called Looper.prepare () 11 : 46: 57.306: E / AndroidRuntime (2140): on android.os.Handler & lt; Init & gt; (Handler.java:197) 11:. 46: 57.306: E / AndroidRuntime (2140):. On &roid.os.Handler & lt; Init & gt; (Handler.java:111) 11: 46: 57.306: E / AndroidRuntime (2140): android.app.Dialog at & lt; Init & gt; (Dialog.java:107) 11:. 46: 57.306: E / AndroidRuntime (2140): make android.app.AlertDialog & lt; Init & gt; (AlertDialog.java:114) 11:. 46: 57.306: E / AndroidRuntime (2140): $ Builder.create (AlertDialog.java:931) at android.app.AlertDialog 11: 46: 57.306: E / Android Random (2140): at com.example.core4voipmobiledialer. welcome. ShowRelert (Welcome 116) 11: 46: 57.306: E / Android Random (2140): Aler.Welcome $ 1.run at com.example.core4voipmobiledi (welcome.java35)
to show RunOnUiThread
toast or
alert dialog for.
runOnUiThread {NewOnRunball} {@Override Public Zero Run () {ShowAlert (); }});
Comments
Post a Comment