Showing webview in AndEngine GLES 2 while the game is running on Android -
i working on game while game running need show webview instructions web possible?
these instructions shown again , again , dynamic coming server.
can please me that? cannot use layoutbasegameactivity don't want show them always.
i want pause game , show webview clickable. please help.
you can add game activity show webview , call openwebviewurl or openwebviewhtml when need
@override protected void onsetcontentview() { final framelayout framelayout = new framelayout(this); final framelayout.layoutparams framelayoutlayoutparams = new framelayout.layoutparams(framelayout.layoutparams.fill_parent, framelayout.layoutparams.fill_parent); mrendersurfaceview = new rendersurfaceview(this); mrendersurfaceview.setrenderer(mengine, this); final android.widget.framelayout.layoutparams surfaceviewlayoutparams = new framelayout.layoutparams(super.createsurfaceviewlayoutparams()); final framelayout.layoutparams webviewlayoutparams = new framelayout.layoutparams(framelayout.layoutparams.wrap_content, 100, gravity.center_horizontal|gravity.bottom); webview = new webview(this); framelayout.addview(this.mrendersurfaceview, surfaceviewlayoutparams); framelayout.addview(webview, webviewlayoutparams); this.setcontentview(framelayout, framelayoutlayoutparams); webview.setvisibility(webview.invisible); } private void openwebviewurl(string url) { webview.loadurl(url); this.runonuithread(new runnable() { @override public void run() { webview.setvisibility(webview.visible); } }); } private void openwebviewhtml(string html) { webview.loaddata(html,"text/html", "en_us"); this.runonuithread(new runnable() { @override public void run() { webview.setvisibility(webview.visible); } }); }
Comments
Post a Comment