WebView is a UI component it must be in the context of an Activity or Fragment, so loadUrl() from the UI thread is OK.
If you want to make a server call, process the response before displaying something on the UI, then you might just use the conventional options to connect to a server URL using the HttpURLConnection. See the sample code below:
URL url = new URL("http://www.android.com/");
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
try {
InputStream in = new BufferedInputStream(urlConnection.getInputStream());
readStream(in);
finally {
urlConnection.disconnect();
}
}
In this example, you really need to execute it in a background Thread. Never from the UI Thread.