Back to project page Broadsheet.ie-Android.
The source code is released under:
Copyright (c) 2013 Karl Monaghan (http://karlmonaghan.com/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Soft...
If you think the Android project Broadsheet.ie-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package ie.broadsheet.app.dialog; //from w ww.j a v a2s .com import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.webkit.WebView; public class WebViewDialog extends DialogFragment { public static WebViewDialog newInstance(String localHtml) { WebViewDialog frag = new WebViewDialog(); Bundle args = new Bundle(); args.putString("localHtml", localHtml); frag.setArguments(args); return frag; } public Dialog onCreateDialog(Bundle savedInstanceState) { String localHtml = getArguments().getString("localHtml"); if (localHtml == null) { localHtml = "about"; } WebView webView = new WebView(getActivity()); webView.loadUrl("file:///android_asset/" + localHtml + ".html"); AlertDialog.Builder dialog = new AlertDialog.Builder(getActivity()); dialog.setView(webView); dialog.setPositiveButton("Okay", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); return dialog.create(); } }