2012-08-14 6 views

답변

0

마크 플레이스 홀더는 HTML에서 제목에 대한 동적 문자열로 대체됩니다 - %NAME%
그럼 난 내 HTML로드합니다 : 다음

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

을 모든 다이나믹 부품을 내가 원하는 것과 바꿀 것입니다 :

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

그런 다음 웹 뷰로 전달합니다!

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