Android- application crashes java.lang.IllegalArgumentException: View not attached to window manager -


developed android application have included webview along progress bar , support orientation change application crashes generating following error:

java.lang.illegalargumentexception: view not attached window manager

here code:-

protected progressdialog mspinner;         @override         protected void oncreate(bundle savedinstancestate) {             requestwindowfeature(window.feature_no_title);             mspinner = new progressdialog(this);             mspinner.setmessage("loading..please wait!");             setcontentview(r.layout.activity_main);                     webview mywebview = (webview) findviewbyid(r.id.webview);                     mywebview.loadurl("http://www.google.com");}             @override         public void onconfigurationchanged(configuration newconfig){             super.onconfigurationchanged(newconfig);         }     public class mycustomwebviewclient extends webviewclient {             @override             public boolean shouldoverrideurlloading(webview view, string url) {                             view.loadurl(url);                return true;             }              @override             public void onpagestarted(webview view, string url, bitmap favicon) {                 super.onpagestarted(view, url, favicon);                // log.d("mytag","page loading started");                  mspinner.show();             }              @override             public void onpagefinished(webview view, string url) {                 super.onpagefinished(view, url);                      if ( mspinner.isshowing()) {                          mspinner.dismiss();              //log.d("mytag","page loading finished");                 //mspinner.dismiss();             }         } 


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -