Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Hector Romero
6,151 PointsURL not loading in WebView (Android)
Hi!
I'm trying to load a 'chart' from a URL in a WebView but it doesn't work. However some other URLs load.
This is the URL:
http://api.thingspeak.com/channels/14210/charts/1
This is how I'm doing it:
mPlotWebView.loadUrl("http://api.thingspeak.com/channels/14210/charts/1");
And this is the error I get:
E/chromium﹕ [ERROR:buffer_manager.cc(313)] [.Parent-Compositor-0xa3117b00]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
How can I do it?
Thanks!
2 Answers

Jon Kussmann
Courses Plus Student 7,254 PointsI missed the part where you said other URLs are loading properly.
Try enabling Javascript:
mPlotWebView.getSettings().setJavaScriptEnabled(true);

Jon Kussmann
Courses Plus Student 7,254 PointsHave you set a weblient for your webview?
mPlotWebView.setWebViewClient(new WebViewClient());
Hector Romero
6,151 PointsHector Romero
6,151 PointsThank you, Jon! It works now.
Jon Kussmann
Courses Plus Student 7,254 PointsJon Kussmann
Courses Plus Student 7,254 PointsNo problem!