Sunday, 29 September 2013

andEngine alertdialog error

andEngine alertdialog error

error java.lang.RuntimeException: Can't create handler inside thread that
has not called Looper.prepare() =(
if I call showDialog (id) into GameActivity - works If the calling
activity.showDialog from another class - a mistake
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case 1:
Log.d("Dialog", "Dialog 1");
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Help");
alert.setMessage("Help");
WebView wv = new WebView(this);
wv.loadUrl("http:\\www.google.com");
wv.setWebViewClient(new WebViewClient()
{
@Override
public boolean shouldOverrideUrlLoading(WebView view, String
url)
{
view.loadUrl(url);
return true;
}
});
alert.setView(wv);
AlertDialog ALERT = alert.create();
return ALERT;
default:
return null;
}
}
I want to call a dialog with any other class

No comments:

Post a Comment