Example usage for android.webkit WebView loadUrl

List of usage examples for android.webkit WebView loadUrl

Introduction

In this page you can find the example usage for android.webkit WebView loadUrl.

Prototype

public void loadUrl(String url) 

Source Link

Document

Loads the given URL.

Usage

From source file:cheng.app.cnbeta.OpenSourceLicensesFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    WebView webView = new WebView(getActivity());
    webView.loadUrl("file:///android_asset/licenses.html");

    return new AlertDialog.Builder(getActivity()).setTitle(R.string.about_licenses).setView(webView)
            .setPositiveButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int whichButton) {
                    dialog.dismiss();/*from  w w w. j  ava  2 s .  c  o  m*/
                }
            }).create();
}

From source file:com.customlbs.android.presentation.legal.LicenseDetailFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    WebView webView = new WebView(getActivity());
    webView.loadUrl("file:///android_asset/" + licensePath);
    webView.getSettings().setSupportZoom(true);
    webView.getSettings().setBuiltInZoomControls(true);

    return webView;
}

From source file:com.google.samples.apps.ledtoggler.LicenseDialog.java

@NonNull
@Override/* w w  w . j av a 2s  .com*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    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(DialogInterface dialog, int whichButton) {
                    dialog.dismiss();
                }
            }).create();
}

From source file:com.dgsd.android.ShiftTracker.LicensesActivity.java

@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getSupportActionBar().setTitle(R.string.licenses);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setIcon(R.drawable.ic_launcher);

    WebView wv = new WebView(this);
    wv.loadUrl("file:///android_asset/about.html");

    setContentView(wv);//from www. j a v  a  2  s  .  com
}

From source file:com.leinardi.ubuntucountdownwidget.ui.dialogs.OpenSourceLicensesDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    WebView webView = new WebView(getActivity());
    webView.loadUrl(LICENSES_PATH);

    return new AlertDialog.Builder(getActivity(), R.style.AppCompatAlertDialogTheme)
            .setTitle(R.string.open_source_licenses).setView(webView)
            .setPositiveButton(R.string.close, new DialogInterface.OnClickListener() {

                @Override//from w  w  w .j ava  2 s .  co m
                public void onClick(DialogInterface dialog, int which) {
                    dismiss();
                }
            }).create();
}

From source file:com.google.android.apps.santatracker.launch.LicenseDialogFragment.java

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    final WebView web = (WebView) view.findViewById(R.id.web);
    web.loadUrl("file:///android_asset/licenses.html");
}

From source file:com.just.agentweb.AgentWebUtils.java

static final void clearWebView(WebView m) {

    if (m == null) {
        return;/*w w w. j  a  va2  s  .  c  o  m*/
    }
    if (Looper.myLooper() != Looper.getMainLooper()) {
        return;
    }
    m.loadUrl("about:blank");
    m.stopLoading();
    if (m.getHandler() != null) {
        m.getHandler().removeCallbacksAndMessages(null);
    }
    m.removeAllViews();
    ViewGroup mViewGroup = null;
    if ((mViewGroup = ((ViewGroup) m.getParent())) != null) {
        mViewGroup.removeView(m);
    }
    m.setWebChromeClient(null);
    m.setWebViewClient(null);
    m.setTag(null);
    m.clearHistory();
    m.destroy();
    m = null;

}

From source file:org.lytsing.android.weibo.ui.WebViewDialog.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setTitle(getIntent().getIntExtra(Intent.EXTRA_TITLE, R.string.app_name));

    setContentView(R.layout.activity_licenses);

    WebView webView = (WebView) findViewById(R.id.content);
    webView.loadUrl(getIntent().getStringExtra(Intent.EXTRA_STREAM));
}

From source file:com.jkenneth.droidovpn.ui.fragment.LicensesDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    WebView webView = new WebView(getActivity());
    webView.loadUrl("file:///android_asset/licenses.html");

    return new AlertDialog.Builder(getActivity()).setTitle(R.string.open_source_licenses).setView(webView)
            .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int whichButton) {
                    dialog.dismiss();/*from   w ww  . ja va 2s . c  o m*/
                }
            }).create();
}

From source file:se.eliga.aves.HelpFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    WebView webView = (WebView) getView().findViewById(R.id.help_text);
    webView.loadUrl("file:///android_asset/help.html");
    webView.setBackgroundColor(0x00FFFFFF);
    webView.setVisibility(View.VISIBLE);
}