I am trying to open a URL using WebView (positioned inside a Fragment) from AsyncTask.
Butterknife is being used to bind the view (WebView in this). The following code related to WebView is written inside doInBackground()
of AsyncTask
mWebView.getSettings().setJavaScriptEnabled(false);
mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
However, on writing the code related to WebView, the IDE warns me with "Method getSettings() must be called from the UI thread, currently inferred thread is worker"
What does this mean? I am sorry, but can someone explain what's happening. Should I use something like runOnUiThread()
?