Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

net::ERR_ACCESS_DENIED Android error while opening WebPage in Android Activity

Android WebPage showing net::ERR_ACCESS_DENIED while opening Android activity Embedded with with WebPage Tag

I tried to provide permission in Android Manifest.

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

webview:

    WebView webView;
    webView = (WebView)findViewById(R.id.webbrowser);
    webView.setWebViewClient(new WebViewClient());
    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setDomStorageEnabled(true);
    webView.getSettings().setLoadWithOverviewMode(true);
    webView.getSettings().setUseWideViewPort(true);
    webView.getSettings().setBuiltInZoomControls(true);
    webView.getSettings().setPluginState(WebSettings.PluginState.ON);
    webView.loadUrl("http://basic-testing-faq.blogspot.com/");

I getting net::ERR_ACCESS_DENIED

enter image description here

like image 252
Ritesh Toppo Avatar asked May 26 '19 08:05

Ritesh Toppo


3 Answers

Uninstall.

Install again.

This solved it for me.

like image 174
Lukas Schneider Avatar answered Oct 19 '22 00:10

Lukas Schneider


Make sure internet permission is given and add android:usesCleartextTraffic="true" if you use http website.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="in.example.application">

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

<application
    android:allowBackup="false"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:usesCleartextTraffic="true"
    tools:targetApi="m">

    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
            <action android:name="android.intent.action.VIEW"/>
        </intent-filter>
    </activity>
</application>

like image 6
Aashish Avatar answered Oct 19 '22 01:10

Aashish


All you need, clear the data, un-install the app an re-installed it. After that, put this code to <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> and put this code to webview class

webSettings.setJavaScriptEnabled(true);

webSettings.setAllowContentAccess(true);
webSettings.setAppCacheEnabled(true);
webSettings.setDomStorageEnabled(true);
webSettings.setUseWideViewPort(true);
like image 1
tu le Avatar answered Oct 19 '22 01:10

tu le