WebView does not show the page

1

I set up my WebView to display the privacy policy of my application, but when it opens it appears that the web page is not available. See:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    WebView webView = (WebView) findViewById(R.id.wv_content);
    webView.loadUrl("https://paivadeveloperpolitica.wordpress.com/2017/03/28/politica-de-privacidade/");
}

I have tried in several ways, taking out HTTOS, leaving only HTTP, only www. , but in no way worked.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@android:color/white">

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

</RelativeLayout>
    
asked by anonymous 29.03.2017 / 03:54

1 answer

1

The way you are doing is correct, however, you need to grant internet access permission on your AndroidManifest.xml so that the page opens through your WebView . See below:

<uses-permission android:name="android.permission.INTERNET" />
    
29.03.2017 / 04:43