Wednesday, February 19, 2014

Js to the page biography is empty about webview load local html, execution


Such as the title,
List projectbeanlist = new ArrayList () ;/ / CtArticle article data class
List > projectList = new ArrayList > ();
projectbeanlist = service.findAll () ;/ / get the data from the database
projectList = service.toArrayList (projectbeanlist);
String str = "javascript: test (" + projectList.get (position) get ("content") toString () +.. ")";
webview.loadUrl (str);



public ArrayList > toArrayList (List list) {
ArrayList > mapList = new ArrayList > ();
for (CtArticle data: list) {
try {
HashMap map = new HashMap ();

map.put ("id", data.getId ());
map.put ("cid", data.getCid ());
map.put ("cidName", SystemUtil.showText (data.getCidName ()));
map.put ("FCid", data.getFCid ());
map.put ("FCidName", SystemUtil.showText (data.getFCidName ()));
map.put ("name", SystemUtil.showText (data.getName ())) ;/ / title
map.put ("isActive", data.getIsActive ());
map.put ("shareFrom", SystemUtil.showText (data.getShareFrom ())) ;/ / create people
map.put ("author", SystemUtil.showText (data.getAuthor ())) ;/ / Source
map.put ("content", SystemUtil.showText (data.getContent ())) ;/ / content
map.put ("summary", SystemUtil.showText (data.getSummary ())) ;/ / Summary
map.put ("file1", data.getFile1 ());
map.put ("img1", data.getImg1 ());
map.put ("keyword", data.getKeyword ());
map.put ("hitNums", data.getHitNums ());
map.put ("postTime", data.getPostTime ());
map.put ("scorePeople", data.getScorePeople ());
map.put ("scoreAverage", data.getScoreAverage ());
map.put ("isRead", data.getIsRead ());
map.put ("isFavorite", data.getIsFavorite ());
map.put ("musicUrl", data.getMusicUrl ());
mapList.add (map);
} Catch (Exception e) {
Log.v (TAG, e.getMessage ());
}
}

return mapList;
}




This value reached a page is empty, projectList.get (position). Get ("content"). ToString () is a string ah? If it had been specified string file :/ / / android_asset / content_loading.png or "helloword" are achievable, have not encountered this situation, the master to the point<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Results posted, js problem

No comments:

Post a Comment