2012-08-14 61 views

回答

0

马克占位在HTML - %NAME%
话,我会加载我的HTML:

String template = Utils.inputStreamToString(assets.open("html/template.html")); 

然后我会用我想要的所有动态部分替换:

String data = template.replaceAll("%NAME%", "Alice McGee"); 

然后我会把它传递给我的webView!

WebView webView = new WebView(this); 
webView.loadDataWithBaseURL("file:///android_asset/html/", data, "text/html", "utf-8", null);