sandesh bafna
sandesh bafna

Reputation: 31

Unable to load a page in android web view

I am trying to learn android web view I added everything loadurl method user permission to internet and a web view tag I don't know it is unable to load web page and show err_cache_missing I tried to search my problem but didn't find anywhere can someone help

android file:

manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.vijayrajbafna.utopia2k18">
    <uses-permission android:name="android.permission.INTRNET"/>
    <uses-permission 
android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
    <application .............

java file:

 WebView vv=(WebView)findViewById(R.id.webber);
            WebSettings webset=vv.getSettings();
            webset.setJavaScriptEnabled(true);
            final int ss=1;             
            webset.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
            vv.loadUrl("http://www.facebook.com");

XML file:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.vijayrajbafna.utopia2k18.MainActivity"
android:background="#000000">

<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
android:id="@+id/webber"
tools:ignore="InvalidId"></WebView>
<ImageView
    android:id="@+id/imageer"

Upvotes: 0

Views: 107

Answers (1)

ruben
ruben

Reputation: 1750

There's a typo in your permission :

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

should be

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

Upvotes: 2

Related Questions