Back to project page NoiseBridge_General.
The source code is released under:
GPLv3.txt
If you think the Android project NoiseBridge_General 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.noysbrij.fragments; // w ww. ja v a 2 s. co m import android.os.*; import android.support.v4.app.*; import android.view.*; import android.webkit.*; import com.noysbrij.noisebridgeGeneral.*; import java.lang.ref.*; import android.support.v4.app.Fragment; import org.apache.cordova.*; public class NBWebViewFragment extends Fragment { public static final String ARG_URL = "webUrl"; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // The last two arguments ensure LayoutParams are inflated // properly. View rootView = inflater.inflate( R.layout.layout_webview, container, false); Bundle args = getArguments(); WeakReference<WebView> webViewReference = new WeakReference<WebView>((CordovaWebView)rootView.findViewById(R.id.webview_window)); webViewReference.get().getSettings().setJavaScriptEnabled(true); WebSettings webSettings = webViewReference.get().getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setBuiltInZoomControls(false); webViewReference.get().requestFocusFromTouch(); // webViewRef.get().addJavascriptInterface(new jsInterface(getContext()), "Android"); webViewReference.get().setWebChromeClient(new WebChromeClient()); webViewReference.get().loadUrl(NoiseBridgeGeneral.websites[args.getInt(ARG_URL)]); return rootView; } }