While WebViews need to be manipulated in a single thread, it does not have to be a UI thread (unless you want to attach a WebView to a hierarchy of views), but it must be the same thread for all WebViews.
Although this is clearly not supported (or heavily tested), there is nothing special that WebView does so that you do not run it in a service. WebView does indeed call several methods in a context that usually do not work in the service (e.g. getThememe ()), so you have to get around this with ContextWrapper. You also need to manually call WebView.layout to trick WebView into thinking that it has size. There may be more things that you will need to do, but nothing comes to mind.
source share