ウェブページをアンドロイドウェブビューに読み込んで、URLから画像をJavaScript経由でウェブページに読み込みました。ページが読み込まれていないというエラーが表示されます。ウェブビューでウェブ画像が読み込まれない
[INFO:CONSOLE(0)] "Image from origin 'https://s-media-cache-ak0.pinimg.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.", source: file:///android_asset/demo3.html (0)
私のJavaコードは次のとおりです。
WebView wv = (WebView) vw.findViewById(R.id.help_webview);
WebSettings webSettings = wv.getSettings();
webSettings.setJavaScriptEnabled(true);webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
wv.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
wv.loadUrl("file:///android_asset/demo3.html");
そしてXMLは、単純なWeb表示一般に
<WebView
android:id="@+id/help_webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</WebView>
あなたの努力を示してください。これまでに行ったことをあなたのコードを共有してください。 –
お返事ありがとうございました。以前にコードを投稿しない理由は、非常に簡単なwebviewです。あなたが尋ねたように、私はコードを何らかの方法で追加しました。任意のsuggetions? – developer33