Answer the question
In order to leave comments, you need to log in
Page not showing in webview?
Comrades! Greetings!
I am learning to sculpt for Andryusha's robot. Just started - already stuck. All by examples, everything is the same everywhere - I'm trying to load a page of an external site into webview. When debugging on the phone, writes "The web page is not available." The Internet is on on the phone (I specifically launched Telegram to check it), but the link does not want to open in the application. Rights also put INTERNET. What could be the problem?
Just in case, here is the code:
package com.example.tihoho.mytestapplication;
import android.app.Activity;
//import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.*;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
WebView mWebView = (WebView) findViewById(R.id.webView);
String url = "https://ya.ru";
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
WebSettings set = mWebView.getSettings();
set.setJavaScriptEnabled(true);
mWebView.loadUrl(url);
mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
}
protected void isInEditMode()
{}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question