I'm try to put my iframe chart that i took from my thingspeak account.
This is the string i need to put(has i took from thingspeak):
<iframe width="450" height="260" style="border: 1px solid #cccccc;" src="http://api.thingspeak.com/channels/31592/charts/1?width=450&height=260&results=60&dynamic=true" ></iframe>
this what i use on my activity:
WebView webview;
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadData();
I try without success to put my iframe string in "loadData" function.
Thanks to the helpers ;)
You can create a String with the html :
String html = "<iframe width=\"450\" height=\"260\" style=\"border: 1px solid #cccccc;\" src=\"http://api.thingspeak.com/channels/31592/charts/1?width=450&height=260&results=60&dynamic=true\" ></iframe>";
and then call the method loadData():
webview.loadData(html, "text/html", null);
Click Here for reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With