-2
WebView.loadUrl(additionalData.optString("targeturl"));

how to debug error non-static method loadUrl(String) cannot be referenced from a static context

1 Answers1

0

The error is self explanatory, you should call loadUrl on an instance of WebView, it's not a static method, therefore you can't call it statically on the class like you're doing.

e.g.

WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://www.example.com");

also, check out the documentation

samugi
  • 395
  • 5
  • 17