- // Get the host and realm variables from the bundle.
- String httpAuthHost = getArguments().getString("Host");
- String httpAuthRealm = getArguments().getString("Realm");
+ // Remove the incorrect lint warning below that arguments might be null.
+ assert arguments != null;
+
+ // Get the variables from the bundle.
+ String httpAuthHost = arguments.getString("host");
+ String httpAuthRealm = arguments.getString("realm");
+ long webViewFragmentId = arguments.getLong("webview_fragment_id");
+
+ // Get the current position of this WebView fragment.
+ int webViewPosition = MainWebViewActivity.webViewPagerAdapter.getPositionForId(webViewFragmentId);
+
+ // Get the WebView tab fragment.
+ WebViewTabFragment webViewTabFragment = MainWebViewActivity.webViewPagerAdapter.getPageFragment(webViewPosition);
+
+ // Get the fragment view.
+ View fragmentView = webViewTabFragment.getView();
+
+ // Remove the incorrect lint warning below that the fragment view might be null.
+ assert fragmentView != null;
+
+ // Get a handle for the current WebView.
+ NestedScrollWebView nestedScrollWebView = fragmentView.findViewById(R.id.nestedscroll_webview);
+
+ // Get a handle for the HTTP authentication handler.
+ HttpAuthHandler httpAuthHandler = nestedScrollWebView.getHttpAuthHandler();