Show activity over alert dialog builder in Android -
i trying show webview on alertdialog.builder in android , having problem doing that. understand if shown, dialog needs closed in order regain focus of what's behind if situation want show webview above dialog, options? calling webview before calling dialog not solve this.
is approach bad? give thanks you.
this method create dialog
public static void showexitpopup(final context context) { alertdialog.builder builder = new alertdialog.builder(context); builder.settitle("exit?"); builder.seticon(r.drawable.icon); builder.setmessage("\nyou want exit?\n") .setcancelable(false) .setpositivebutton("yes", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { dialog.cancel(); } }); builder.setnegativebutton("cancel", new onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { dialog.cancel(); } }); builder.show(); } this webview:
public static webview create(final context context) { // create webview instance webview webview = new webview(context); // set webview optimize; webview.setvisibility(view.gone); webview.setfocusable(true); webview.setfocusableintouchmode(true); webview.setbackgroundcolor(0x00000000); webview.setwebchromeclient(new webchromeclient()); // init websettings websettings websettings = webview.getsettings(); websettings.setsupportzoom(false); websettings.setjavascriptenabled(true); homecoming webview; } and in different method creating webview , loading specific url , before loading dialog.
android
No comments:
Post a Comment