List of usage examples for android.webkit WebView loadUrl
public void loadUrl(String url)
From source file:com.khmelenko.lab.travisclient.fragment.LicensesDialogFragment.java
@NonNull @Override//from w w w. j ava 2 s. co m public Dialog onCreateDialog(Bundle savedInstanceState) { WebView view = (WebView) LayoutInflater.from(getActivity()).inflate(R.layout.dialog_licenses, null); view.loadUrl("file:///android_asset/opensource_licenses.html"); return new AlertDialog.Builder(getActivity()).setTitle(getString(R.string.dialog_licenses_title)) .setView(view, 0, 25, 0, 0).create(); }
From source file:com.nineducks.hereader.ui.ItemDetailsFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Log.d("hereader", "entering ItemDetailsFragment.onCreateView"); if (container == null) { Log.d("hereader", "leaving ItemDetailsFragment.onCreateView"); return null; }//from w w w . j a v a 2 s.c o m String url = getArguments().getString("url"); WebView webView = new WebView(getActivity().getApplicationContext()); webView.loadUrl(url); Log.d("hereader", "leaving ItemDetailsFragment.onCreateView"); return webView; }
From source file:fit.cvut.cz.ambiant.view.LicenseDialogFragment.java
@NonNull @Override//w w w . ja v a 2 s . c om public Dialog onCreateDialog(Bundle savedInstanceState) { WebView view = (WebView) LayoutInflater.from(getActivity()).inflate(R.layout.dialog_license, null); view.loadUrl("file:///android_asset/license.html"); return new AlertDialog.Builder(getActivity(), R.style.Theme_AppCompat_Light_Dialog_Alert) .setTitle(getString(R.string.action_licenses)).setView(view) .setPositiveButton(android.R.string.ok, null).create(); }
From source file:com.lidaofu.www.loadmoreviewdemo.fragment.TabFragment.java
private void loadWeb(int position) { String url = null;//from w w w . j a v a 2 s . c o m switch (position) { case 0: url = "http://www.baidu.com"; break; case 1: url = "http://wapbaike.baidu.com/?ssid=0&from=844b&bd_page_type=1&uid=0&pu=sz%401321_1001%2Cta%40utouch_2_5.0_3_537&itj=31"; break; case 2: url = "http://www.baidu.com"; break; } WebViewClient client = new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } }; webview.setWebViewClient(client); webview.loadUrl(url); }
From source file:com.ble.eic.git.botspinecommon.HelpView.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(mIdFragment, container, false); WebView wv = (WebView) rootView.findViewById(mIdWebPage); wv.loadUrl("file:///android_asset/" + mFile); return rootView; }
From source file:com.frostox.calculo.fragments.ScreenSlidePageFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout containing a title and body text. ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_screen_slide_page, container, false); WebView webView = (WebView) rootView.findViewById(R.id.web); webView.loadUrl(getString(R.string.base_url_extraclass) + "uploads/" + noteid); return rootView; }
From source file:com.luorrak.ouroboros.miscellaneous.OpenSourceLicenseFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Util.onActivityCreateSetTheme(getActivity(), SettingsHelper.getTheme(getActivity())); super.onCreateView(inflater, container, savedInstanceState); getActivity().setTitle("License"); WebView webView = new WebView(getActivity()); AssetManager am = getActivity().getAssets(); webView.loadUrl("file:///android_asset/license.html"); return webView; }
From source file:com.renard.ocr.help.HelpActivity.java
protected void onCreate(android.os.Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.help_activity); getSupportActionBar().setDisplayHomeAsUpEnabled(true); // getSupportActionBar().setDisplayHomeAsUpEnabled(true); // ViewServer.get(this).addWindow(this); // TextView title = (TextView) findViewById(R.id.abs__action_bar_title); // title.setTextColor(Color.BLACK); // LayoutParams params = (LayoutParams) title.getLayoutParams(); // LinearLayout p = (LinearLayout)title.getParent(); // p.setBackgroundResource(R.drawable.speech_bubble); initAppIcon(this, -1); WebView webView = (WebView) findViewById(R.id.webView_help); webView.loadUrl("file:///android_res/raw/tips.html"); }
From source file:org.mariotaku.twidere.fragment.WebMapFragment.java
@Override public void center() { final WebView webview = getWebView(); webview.loadUrl("javascript:center();"); }
From source file:li.klass.fhem.fragments.FloorplanFragment.java
@Override protected void onPageLoadFinishedCallback(WebView view, String url) { if (url.contains("&XHR=1")) { view.loadUrl(getLoadUrl()); return;/*from w w w.j a v a 2 s . c o m*/ } InputStream modifyJsStream = FloorplanFragment.class.getResourceAsStream("floorplan-modify.js"); try { String modifyJs = IOUtils.toString(modifyJsStream); view.loadUrl("javascript:" + modifyJs); } catch (IOException e) { Log.e(TAG, "cannot load floorplan-modify.js", e); } }