WebView にm.facebook.comを読み込んでいますが、それがどれほど重要かはわかりませんが、WebView は ViewPager 内のコンテナーにあります。
アプリケーションを起動して URL をロードするたびに、次のいずれかの結果が表示されます。
あなたが実際に期待するもの:
しかし、もう 1 つは非常に厄介です。
この 2 つの動作はなぜですか。
XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<WebView
android:id="@+id/Site_WebView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
WebView のセットアップ コード:
webView.loadUrl(item.getUrl());
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setUserAgentString("My User Agent - Android");
webView.setWebChromeClient(new WebChromeClient() {});
webView.setWebViewClient(new WebViewClient() {});
アダプターで xml を膨らませ、コンテナーに追加します...