开发者

href from json in android xml

I have and开发者_如何学C app and on my main menu page I want to load a clickable ad (href) from json.

example :

'nationalad': 
 "<"img src=\"http:\/\/www.mywebsite.com\/images\/national\/fullrz_2_4e657ae4df4ee_mywebsite.JPG\">"

This is the value I am getting back from json :

"<"img src="http://www.mywebsite.com/images/national/fullrz_2_4e657ae4df4ee_kickintheapp.JPG">

How do I set this in my xml page? Do I use a view or webview or an image /image button?

Completely lost.


Use a WebView, and show the data by using loadDataWithBaseURL(null, yourData, "text/html", "utf-8", null);


Hmm this works great for the first run what when I re-run the app the webview is not showing. The only thing that changes is that the image coming in is different on each load.

webView2.loadDataWithBaseURL(null, valArray.getString(1), "text/html", "utf-8", null);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜