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

Android

Hector Romero
Hector Romero
6,151 Points

URL 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
PLUS
Jon Kussmann
Courses Plus Student 7,254 Points

I missed the part where you said other URLs are loading properly.

Try enabling Javascript:

mPlotWebView.getSettings().setJavaScriptEnabled(true);
Jon Kussmann
PLUS
Jon Kussmann
Courses Plus Student 7,254 Points

Have you set a weblient for your webview?

mPlotWebView.setWebViewClient(new WebViewClient());