public final class HtmlDisplayActivity extends Activity {\r
\r
static final String HTML_RES = "html_res";\r
+ static final String HTML = "html";\r
\r
public static Intent getHelpLaunchIntent() {\r
final Intent intent = new Intent();\r
return intent;\r
}\r
\r
+ public static Intent getHtmlIntent(final String html) {\r
+ final Intent intent = new Intent();\r
+ intent.setClassName(HtmlDisplayActivity.class.getPackage().getName(), HtmlDisplayActivity.class.getName());\r
+ intent.putExtra(HTML, html);\r
+ return intent;\r
+ }\r
+\r
/** Called when the activity is first created. */\r
@Override\r
public void onCreate(final Bundle savedInstanceState) {\r
setTheme(((DictionaryApplication)getApplication()).getSelectedTheme().themeId);\r
\r
super.onCreate(savedInstanceState);\r
- setContentView(R.layout.help_activity);\r
+ setContentView(R.layout.html_display_activity);\r
+ \r
final int htmlRes = getIntent().getIntExtra(HTML_RES, -1);\r
- final String html = StringUtil.readToString(getResources().openRawResource(htmlRes));\r
+ final String html;\r
+ if (htmlRes != -1) {\r
+ html = StringUtil.readToString(getResources().openRawResource(htmlRes));\r
+ } else {\r
+ html = getIntent().getStringExtra(HTML);\r
+ }\r
final WebView webView = (WebView) findViewById(R.id.webView);\r
webView.loadData(html, "text/html", "utf-8");\r
\r