Put iframe in android app

I am trying to put my iframe diagram that I took from my account in the world.

This is the line I need to put (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 is what i use for my activity:

  WebView webview; webview = (WebView) findViewById(R.id.webview); webview.getSettings().setJavaScriptEnabled(true); webview.loadData(); 

I am unsuccessfully trying to put an iframe string in the loadData function.

Thanks to the helpers;)

+7
android webview iframe
source share
1 answer

You can create a String using 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 loadData () method:

 webview.loadData(html, "text/html", null); 

Click here for reference.

+16
source share

All Articles