I\'m experiencing an issue with WebViews within my small app. I have the relevant webview with the correct information in my layouts and I have sample code directly from the And
WebView myWebView = (WebView) rootView.findViewById(R.id.webview);
Change your onCreateView
method to:
private WebView webView;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_transition_scene_1, container, false);
final Scene scene = Scene.getSceneForLayout(container, R.layout.fragment_transition_scene_2, getActivity());
Button goButton = (Button)rootView.findViewById(R.id.goButton);
goButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TransitionManager.go(scene);
webView myWebView = (WebView) rootView.findViewById(R.id.webview);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
webView.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
progDailog.show();
view.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, final String url) {
progDailog.dismiss();
}
});
webView.loadUrl("http://www.example.com");
Log.d("","Loading Finished");
}
});
return rootView;
}