List of usage examples for android.webkit WebView loadUrl
public void loadUrl(String url)
From source file:com.googlecode.eyesfree.brailleback.WebViewDialog.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTitle(getIntent().getIntExtra(Intent.EXTRA_TITLE, R.string.pref_os_license_title)); setContentView(R.layout.activity_licenses); WebView webView = (WebView) findViewById(R.id.content); webView.loadUrl(getIntent().getStringExtra(Intent.EXTRA_STREAM)); }
From source file:MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); WebView webview = new WebView(this); setContentView(webview);//from w w w . j av a2s. c o m webview.loadUrl("https://www.java2s.com/"); webview.setWebViewClient(new WebViewClient()); WebSettings webSettings = webview.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setBuiltInZoomControls(true); }
From source file:com.moto.miletus.application.utils.LicenseDialog.java
@NonNull @Override//w ww. ja v a2 s . c o m public Dialog onCreateDialog(Bundle savedInstanceState) { final WebView webView = new WebView(getActivity()); webView.loadUrl("file:///android_asset/licenses.html"); return new AlertDialog.Builder(getActivity()).setView(webView) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(final DialogInterface dialog, int whichButton) { dialog.dismiss(); } }).create(); }
From source file:it.trilogis.android.ww.dialogs.TrilogisAboutDialogFragment.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { // Use the Builder class for convenient dialog construction AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.trilogis_about_layout, null); WebView webView = (WebView) view.findViewById(R.id.webview); webView.loadUrl(Constants.TRILOGIS_ABOUT_URL); builder.setView(view).setPositiveButton(getString(android.R.string.ok), null).setTitle("Trilogis Srl"); return builder.create(); }
From source file:com.sinelead.car.club.XinchepingFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub View v = inflater.inflate(R.layout.activity_content_xincheping, null); WebView webView = (WebView) v.findViewById(R.id.webView_xincheping); webView.setWebChromeClient(new WebChromeClient()); webView.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; }//from ww w . java2s. co m }); webView.getSettings().setJavaScriptEnabled(true); webView.loadUrl("http://m.xincheping.com"); return v; }
From source file:com.abcvoipsip.ui.help.Legal.java
public View getCustomView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.legal_information, container, false); WebView webView = (WebView) v.findViewById(R.id.webview); webView.loadUrl("file:///android_asset/legal.html"); return v;// w w w .j av a2 s . c o m }
From source file:io.github.marktony.espresso.ui.LicensesFragment.java
@Nullable @Override/* ww w .jav a 2 s .c o m*/ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_licenses, container, false); WebView webView = (WebView) view.findViewById(R.id.webView); webView.loadUrl("file:///android_asset/license.html"); return view; }
From source file:tr.xip.wanikani.dialogs.OpenSourceLicensesDialogFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.dialog_open_source_licenses, null); Button mOk = (Button) view.findViewById(R.id.button1); mOk.setOnClickListener(new View.OnClickListener() { @Override/*from w w w . jav a 2 s.c o m*/ public void onClick(View view) { dismiss(); } }); WebView mWebview = (WebView) view.findViewById(R.id.webview); mWebview.loadUrl(licensesUrl); return view; }
From source file:im.vector.util.VectorUtils.java
/** * Display the licenses text.// ww w. ja v a2 s. com * @param activity the activity */ public static void displayThirdPartyLicenses(final Activity activity) { if (null != mMainAboutDialog) { mMainAboutDialog.dismiss(); mMainAboutDialog = null; } activity.runOnUiThread(new Runnable() { @Override public void run() { WebView view = (WebView) LayoutInflater.from(activity).inflate(R.layout.dialog_licenses, null); view.loadUrl("file:///android_asset/open_source_licenses.html"); View titleView = LayoutInflater.from(activity).inflate(R.layout.dialog_licenses_header, null); view.setScrollbarFadingEnabled(false); mMainAboutDialog = new AlertDialog.Builder(activity).setCustomTitle(titleView).setView(view) .setPositiveButton(android.R.string.ok, null).create(); mMainAboutDialog.show(); } }); }
From source file:com.ambergleam.licensesdialogexample.LicensesDialogFragment.java
@NonNull @Override/*from ww w . j a va 2 s. c om*/ public Dialog onCreateDialog(Bundle savedInstanceState) { WebView view = (WebView) LayoutInflater.from(getActivity()).inflate(R.layout.dialog_licenses, null); view.loadUrl("file:///android_asset/open_source_licenses.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(); }