List of usage examples for android.webkit WebView getSettings
public WebSettings getSettings()
From source file:org.odk.collect.android.activities.OpenSourceLicensesActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_open_source_licenses); initToolbar();// w ww . j ava2 s.co m WebView webViewOpenSourceLicenses = (WebView) findViewById(R.id.web_view_open_source_licenses); webViewOpenSourceLicenses.getSettings().setLoadWithOverviewMode(true); webViewOpenSourceLicenses.getSettings().setUseWideViewPort(true); webViewOpenSourceLicenses.getSettings().setTextSize(WebSettings.TextSize.LARGEST); webViewOpenSourceLicenses.loadUrl(LICENSES_HTML_PATH); }
From source file:com.giovanniterlingen.windesheim.controllers.WebViewController.java
public WebView createWebView() { WebView webView = new WebView(activity); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setLoadWithOverviewMode(true); webView.getSettings().setSupportZoom(true); webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setDisplayZoomControls(false); webView.setDownloadListener(new DownloadListener() { public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) { int lastSlash = url.lastIndexOf('/'); String fileName = url.substring(lastSlash + 1); DownloadManager downloadManager = (DownloadManager) activity .getSystemService(Context.DOWNLOAD_SERVICE); DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); request.addRequestHeader("Cookie", new CookieController().getNatSchoolCookie()).setTitle(fileName) .setDescription(activity.getResources().getString(R.string.downloading)) .setDestinationInExternalPublicDir(File.separator + ApplicationLoader.applicationContext.getResources().getString(R.string.app_name), fileName)/*from w w w . j a va 2 s .c om*/ .setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); downloadManager.enqueue(request); } }); return webView; }
From source file:sk.jmurin.android.hradcicva.gui.PagerActivityFragment2.java
@Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); WebView webview = (WebView) getView().findViewById(R.id.contentWebView); webview.getSettings().setJavaScriptEnabled(true); webview.loadUrl("file:///android_asset/" + article.assetUrl); }
From source file:com.ezac.gliderlogs.FlightNotamBLXActivity.java
@Override protected void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.view_list);/*from w ww .j a v a2 s. c o m*/ // hide soft keyboard setMode(); WebView browser = (WebView) findViewById(R.id.webview_1); browser.setWebViewClient(new WebViewClient()); browser.getSettings().setLoadsImagesAutomatically(true); browser.getSettings().setJavaScriptEnabled(true); browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); browser.loadUrl("http://www.notaminfo.com/belgiummap"); }
From source file:com.ezac.gliderlogs.FlightNotamNLDActivity.java
@Override protected void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.view_list);//from w w w . j a v a 2 s.co m // hide soft keyboard setMode(); WebView browser = (WebView) findViewById(R.id.webview_1); browser.setWebViewClient(new WebViewClient()); browser.getSettings().setLoadsImagesAutomatically(true); browser.getSettings().setJavaScriptEnabled(true); browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); browser.loadUrl("http://www.zweefvlieg.net/notam2014/"); }
From source file:com.ezac.gliderlogs.FlightRaspActivity.java
@Override protected void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.view_list);/*from w w w.ja v a2 s. c om*/ // hide soft keyboard setMode(); WebView browser = (WebView) findViewById(R.id.webview_1); browser.setWebViewClient(new WebViewClient()); browser.getSettings().setLoadsImagesAutomatically(true); browser.getSettings().setJavaScriptEnabled(true); browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); browser.loadUrl("http://blipmaps.nl/showblipmap.php?Param=sfctemp&Day=0&Time=1130&Lang=En&Stage=1"); }
From source file:org.gots.ui.WebViewActivity.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { WebView mWebView = new WebView(getActivity()); mWebView.setWebViewClient(new HelloWebViewClient()); mWebView.getSettings().setJavaScriptEnabled(true); Bundle bundle = this.getArguments(); String url = bundle.getString("org.gots.seed.url"); mWebView.loadUrl(url);//ww w . j a v a2 s. c om pd = ProgressDialog.show(getActivity(), "", getResources().getString(R.string.gots_loading), true); pd.setCanceledOnTouchOutside(true); return mWebView; }
From source file:com.commonsware.android.feedfrags.ContentFragment.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); WebView browser = getBrowser(); browser.setWebViewClient(new RedirectFixer()); browser.getSettings().setJavaScriptEnabled(true); if (savedInstanceState != null) { browser.restoreState(savedInstanceState); } else if (urlToLoad != null) { loadUrl(urlToLoad);/*from w w w.j a v a 2 s .co m*/ } }
From source file:com.rstar.mobile.thermocouple.ui.DatabaseFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment_info, parent, false); getActivity().setTitle(title);//from w w w . j a v a 2 s . co m WebView webView = (WebView) v.findViewById(R.id.fragmentInfo_webView); WebSettings webSettings = webView.getSettings(); webSettings.setJavaScriptEnabled(true); try { webView.loadUrl(AppSettings.databaseLink); } catch (Exception e) { } return v; }
From source file:com.ezac.gliderlogs.FlightADSBActivity.java
@Override protected void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.view_list);/*from w ww . java 2s . c om*/ // hide soft keyboard setMode(); WebView browser = (WebView) findViewById(R.id.webview_1); browser.setWebViewClient(new WebViewClient()); browser.getSettings().setSupportZoom(true); browser.getSettings().setBuiltInZoomControls(true); browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); browser.setScrollbarFadingEnabled(true); browser.getSettings().setLoadsImagesAutomatically(true); browser.getSettings().setDomStorageEnabled(true); browser.getSettings().setAppCacheEnabled(true); browser.getSettings().setAppCacheMaxSize(1024 * 1024 * 32); String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath(); browser.getSettings().setAppCachePath(appCachePath); browser.getSettings().setAllowFileAccess(true); browser.getSettings().setJavaScriptEnabled(true); browser.loadUrl("http://86.83.189.66:8099//gmap.php"); }