Back to project page utexas-utilities.
The source code is released under:
Apache License
If you think the Android project utexas-utilities listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.nasageek.utexasutilities.fragments; /*from w w w.jav a 2 s . c om*/ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.WebView; import android.webkit.WebViewClient; import com.actionbarsherlock.app.SherlockFragment; public class NutritionInfoFragment extends SherlockFragment { public NutritionInfoFragment() { } public static NutritionInfoFragment newInstance(String url) { NutritionInfoFragment nif = new NutritionInfoFragment(); Bundle args = new Bundle(); args.putString("url", url); nif.setArguments(args); return nif; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO: figure out how to save state of the WebView final WebView wv = new WebView(getActivity()); wv.getSettings().setBuiltInZoomControls(true); wv.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { return false; } }); wv.loadUrl(getArguments().getString("url")); return wv; } }