3
I would like the dialog close after 10 seconds. I can only do it by clicking the button.
Follows the code.
AlertDialog.Builder alert = new AlertDialog.Builder(this);
WebView wv = new WebView (this);
WebSettings webSettings = wv.getSettings();
webSettings.setJavaScriptEnabled(true);
wv.loadUrl("http://192.168.200.233:8888/Propagandas/Propagandas.html");
wv.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
view.loadUrl(request.getUrl().toString());
return true;
}
});
alert.setView(wv);
alert.setNegativeButton("Fechar", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
alert.show();
Handler handler = new Handler();
handler.postDelayed( this, 2000 );
It is possible?
When I put in the code, you ask me to put Alert at the end and when I put in the code you tell me which method can’t be applied, you know what I need to do?
– Eduardo Santos
@Eduardosantos declares Alert as Global, outside onCreate. Only the variable.
– viana
Cannot find Symbol method isshowing, what appears.
– Eduardo Santos
You know what it can be?
– Eduardo Santos
@Eduardosantos made a change using Dialog. Look now, it worked pretty here with me. = D
– viana
Thank you very much
– Eduardo Santos