android - WebView is not able to show Website -


here code:

xml

   <webview     android:id="@+id/webview"     android:layout_width="match_parent"     android:layout_height="match_parent"     /> 

mainactivity.java excerpt

    @override     protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main);      webview mywebview = (webview)findviewbyid(r.id.webview);     mywebview.loadurl("http://www.google.com");     mywebview.setwebviewclient(new webviewclient()); } 

this should show google page upon starting app. every time run this, error of "webpage not available, webpage might temporarily down or may have moved new web address, etc"

any ideas?

make sure connected internet , have following permission in manifest:

<uses-permission android:name="android.permission.internet"></uses-permission>  

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -