Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java WebView显示自Android 7以来的空白白页_Java_Android_Webview - Fatal编程技术网

Java WebView显示自Android 7以来的空白白页

Java WebView显示自Android 7以来的空白白页,java,android,webview,Java,Android,Webview,下面的代码在Android 7之前的设备上运行良好。使用Android 7和8WebView时,会显示空白的白色屏幕,而不是某些内容: java部分: public static class QuickIntroFragment1 extends Fragment{ @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup co

下面的代码在Android 7之前的设备上运行良好。使用Android 7和8
WebView
时,会显示空白的白色屏幕,而不是某些内容:

java部分:

public static class QuickIntroFragment1 extends Fragment{
        @Nullable
        @Override
        public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
            View view = inflater.inflate(R.layout.layout_web_view, container, false);
            WebView wv = (WebView) view.findViewById(R.id.wv_intro);
            wv.loadUrl("file:///android_res/raw/learn_methodology.html");
            return view;
        }
    }
<uses-permission android:name="android.permission.INTERNET" />
    <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>Word Dolphin documentation</title>
    <style type="text/css">
      ul{
      margin-left:-17px;
      }
    </style>
</head>
<body>
<p>Language learning consists of several parts: skill of creating and understanding of sentences, vocabulary filling, pronunciation training and communication skills. Word Dolphin helps to learn words and prevent to forget it.</p>
<ul>
    <li>if you want to come to a mutual understanding you need to know about 3000 words. 7-9  thousand words will be sufficient for everyday communication. Where to get these words? Firstly, you can search by phrases similar to "1000 most popular words". Secondly, just read in the learning language. Preferably, these texts on the well-known theme. So, except the most popular words, you obtain living language samples.</li>
    <li>after you have found the unknown word, add it to WordDolphin and define translation. In fact, there may be a lot of meanings of the word. But you should learn 3 or 4 most used meanings. Learn it. Optimal quantity is 2 or 3 meanings because more will be difficult to remember. For many languages, Google or Microsoft Translator shows the most used meanings, pronunciation samples, etc.</li>
    <li>after you have added unknown words with translations, you can remember them. First learn few words, for example 5, and step by step increase its quantity. The main rule here: they should be easy to remember. It is necessary to listen to pronunciation and try to repeat it. Very good practice to remember words is writing.</li>
    <li>finally, check the meaning. It is necessary because learned words will be forgotten fast without practice. Firstly repeat newly learned words, then the rest. Word Dolphin keeps up your skills and based on it will create checklist.</li>
</ul>
<p>For read more tap ☰ and select <b>Info</b>.</p>
<p>Good work!</p>
</body>
</html>
AndroidManifest已包含必要的权限:

public static class QuickIntroFragment1 extends Fragment{
        @Nullable
        @Override
        public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
            View view = inflater.inflate(R.layout.layout_web_view, container, false);
            WebView wv = (WebView) view.findViewById(R.id.wv_intro);
            wv.loadUrl("file:///android_res/raw/learn_methodology.html");
            return view;
        }
    }
<uses-permission android:name="android.permission.INTERNET" />
    <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>Word Dolphin documentation</title>
    <style type="text/css">
      ul{
      margin-left:-17px;
      }
    </style>
</head>
<body>
<p>Language learning consists of several parts: skill of creating and understanding of sentences, vocabulary filling, pronunciation training and communication skills. Word Dolphin helps to learn words and prevent to forget it.</p>
<ul>
    <li>if you want to come to a mutual understanding you need to know about 3000 words. 7-9  thousand words will be sufficient for everyday communication. Where to get these words? Firstly, you can search by phrases similar to "1000 most popular words". Secondly, just read in the learning language. Preferably, these texts on the well-known theme. So, except the most popular words, you obtain living language samples.</li>
    <li>after you have found the unknown word, add it to WordDolphin and define translation. In fact, there may be a lot of meanings of the word. But you should learn 3 or 4 most used meanings. Learn it. Optimal quantity is 2 or 3 meanings because more will be difficult to remember. For many languages, Google or Microsoft Translator shows the most used meanings, pronunciation samples, etc.</li>
    <li>after you have added unknown words with translations, you can remember them. First learn few words, for example 5, and step by step increase its quantity. The main rule here: they should be easy to remember. It is necessary to listen to pronunciation and try to repeat it. Very good practice to remember words is writing.</li>
    <li>finally, check the meaning. It is necessary because learned words will be forgotten fast without practice. Firstly repeat newly learned words, then the rest. Word Dolphin keeps up your skills and based on it will create checklist.</li>
</ul>
<p>For read more tap ☰ and select <b>Info</b>.</p>
<p>Good work!</p>
</body>
</html>

这种行为出现在Google Android Emulator上。所以这不是我的问题。

似乎是我的硬件有问题,因为有了更强大的硬件和相同的模拟映像,我没有发现这个bug。

似乎是我的硬件有问题,因为有了更强大的硬件和相同的模拟映像,我没有发现这个bug。

@AmitVaghela No,我使用谷歌Android模拟器更新这些问题。@AmitVaghela我已经更新了我的postcan,请根据我的观察更新HTML页面没有body标签的开头,然后再试一次@DamodharMeshram请参见更新的
html
@AmitVaghela否,我使用谷歌Android模拟器更新该问题。@AmitVaghela我已更新我的帖子,请根据我的观察更新html页面没有body标签的开头,然后重试@DamodharMeshram见更新的
html