List of usage examples for android.webkit WebView loadUrl
public void loadUrl(String url)
From source file:com.salesforce.marketingcloud.android.demoapp.ui.OriginalDocsActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WebView markdownView = (WebView) findViewById(R.id.markdownView); markdownView.getSettings().setJavaScriptEnabled(true); markdownView.loadUrl(getResources().getString(R.string.official_remote_url)); markdownView.setWebViewClient(new WebViewClient() { @Override//from w w w . ja v a 2 s. co m public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return false; } }); MarketingCloudSdk.requestSdk(new MarketingCloudSdk.WhenReadyListener() { @Override public void ready(MarketingCloudSdk marketingCloudSdk) { marketingCloudSdk.getAnalyticsManager().trackPageView("data://OriginalDocsActivity", getResources().getString(R.string.official_remote_url), null, null); } }); }
From source file:com.hhs.hfnavigator.slidingtabs.harbinger.SportsFragment.java
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview, null); WebView webView = (WebView) root.findViewById(R.id.webView); if (webView != null) { webView.setWebViewClient(new WebViewClient()); webView.loadUrl("http://www.harbingernews.net/sports"); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); webView.getSettings().setBuiltInZoomControls(true); }/* w w w. j a v a 2s .c om*/ return root; }
From source file:com.xperia64.cosi.WebFragment.java
@SuppressLint("SetJavaScriptEnabled") public void updateUrl(String url) { curURL = url;//w w w. j a v a 2 s . c o m WebView webview = (WebView) getView().findViewById(R.id.web); webview.getSettings().setJavaScriptEnabled(true); webview.loadUrl(url); }
From source file:io.github.waka.sevenhack.activities.LicenseActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = DataBindingUtil.setContentView(this, R.layout.activity_license); initToolbar();/*from www. j a va 2 s. c om*/ WebView webView = binding.webView; webView.getSettings().setLoadWithOverviewMode(true); webView.getSettings().setUseWideViewPort(true); webView.loadUrl(LICENSES_HTML_PATH); }
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.commonsware.android.print.MainActivity.java
private void printWebPage() { WebView print = prepPrintWebView(getString(R.string.web_page)); print.loadUrl("http://commonsware.com/Android"); }
From source file:com.github.ekulf.spotifystreamer.LicensesFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { WebView webView = new WebView(getActivity()); webView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); webView.loadUrl("file:///android_asset/licences.html"); return webView; }
From source file:it.gaiacri.mobile.AboutAttivita.java
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { LinearLayout v = (LinearLayout) inflater.inflate(R.layout.activity_about, container, false); ((TextView) v.findViewById(R.id.about_title)).setText("Gaia Mobile v " + getString(R.string.app_version)); GaiaGoogleAnalytics.notifyScreen(getActivity().getApplicationContext(), "About"); //licenza// w w w .j av a 2 s. com ((TextView) v.findViewById(R.id.about_licenza)) .setText(Html.fromHtml("Questa applicazione rilasciata con licenza <a href=\"\">GPL v3</a>")); ((TextView) v.findViewById(R.id.about_licenza)).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { AlertDialog.Builder alert = new AlertDialog.Builder(AboutAttivita.this.getActivity()); WebView wv = new WebView(AboutAttivita.this.getActivity()); wv.loadUrl("https://raw.githubusercontent.com/CroceRossaItaliana/gaia-android/master/LICENSE.txt"); wv.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } }); alert.setView(wv); alert.setNegativeButton("Chiudi", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }); alert.show(); } }); //portale gaia ((TextView) v.findViewById(R.id.about_portale_gaia)) .setText(Html.fromHtml("<a href=\"\">Portale Gaia</a>")); ((TextView) v.findViewById(R.id.about_portale_gaia)).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Internet("https://gaia.cri.it"); } }); //informazioni gaia ((TextView) v.findViewById(R.id.about_gaia)).setText(Html.fromHtml("<a href=\"\">Informazioni GAIA</a>")); ((TextView) v.findViewById(R.id.about_gaia)).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Internet("https://gaia.cri.it/?p=public.about"); } }); //portale sviluppo mobile ((TextView) v.findViewById(R.id.about_gaia_mobile)) .setText(Html.fromHtml("<a href=\"\">Codice Sorgente Gaia Mobile</a>")); ((TextView) v.findViewById(R.id.about_gaia_mobile)).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Internet("https://github.com/CroceRossaItaliana/gaia-android"); } }); //infomrazione dati ((TextView) v.findViewById(R.id.about_gaia_privacy)) .setText(Html.fromHtml("<a href=\"\">Informazioni Gestione Dati</a>")); ((TextView) v.findViewById(R.id.about_gaia_privacy)).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Internet("https://gaia.cri.it/?p=public.privacy"); } }); //((WebView)v.findViewById(R.id.about_info))//.setClickable(true);; return v; }
From source file:net.gsantner.opoc.util.ActivityUtils.java
public void showDialogWithRawFileInWebView(String fileInRaw, @StringRes int resTitleId) { WebView wv = new WebView(_context); wv.loadUrl("file:///android_res/raw/" + fileInRaw); AlertDialog.Builder dialog = new AlertDialog.Builder(_context).setPositiveButton(android.R.string.ok, null) .setTitle(resTitleId).setView(wv); dialog.show();/*from ww w.j ava 2s . c o m*/ }
From source file:com.hhs.hfnavigator.slidingtabs.home.BusFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview, null); swipeRefreshLayout = (SwipeRefreshLayout) root.findViewById(R.id.swipe); progressWheel = (ProgressWheel) root.findViewById(R.id.webViewProgress); swipeRefreshLayout.setEnabled(false); final WebView webView = (WebView) root.findViewById(R.id.webView); if (webView != null) { webView.loadUrl("http://vqr.mx/DmkD"); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setDisplayZoomControls(false); webView.setWebViewClient(new WebViewClient() { public void onPageFinished(WebView view, String url) { progressWheel.stopSpinning(); swipeRefreshLayout.setRefreshing(false); webView.setVisibility(View.VISIBLE); }// ww w . j ava2 s .co m }); } progressWheel.spin(); webView.setVisibility(View.INVISIBLE); // swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { // @Override // public void onRefresh() { // if (CheckNetwork.isInternetAvailable(getActivity())) { // webView.reload(); // } // } // }); // // swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright, // android.R.color.holo_red_light, // android.R.color.holo_green_light, // android.R.color.holo_orange_light); return root; }