title: Android Webview css get background url image not showing
body: <p>Android intercept request http based local store the css.. webview get the css file. but can't get the css <strong>background:url('image.jpg')</strong>. I store the local assets folder css and jpg same location but cannot get...</p>
  
  <p>Coding given below:</p>
  
  <pre><code> private WebView mWebView;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      getSupportActionBar().hide();
      setContentView(R.layout.activity_main);
  
      mWebView = (WebView) findViewById(R.id.webView);
      WebSettings webSettings = mWebView.getSettings();
      webSettings.setJavaScriptEnabled(true);
  
      mWebView.setWebViewClient(new WebViewClient() {
          @Override
          public WebResourceResponse shouldInterceptRequest(final WebView view, String url) {
              if (url.contains("tamil.css")) {
                  return getCssWebResourceResponseFromAsset();
              } else {
                  return super.shouldInterceptRequest(view, url);
              }
          }
  
          private WebResourceResponse getCssWebResourceResponseFromAsset() {
              try {
                  return getUtf8EncodedCssWebResourceResponse(getAssets().open("tam.css"));
              } catch (IOException e) {
                  return null;
              }
          }
  
          private WebResourceResponse getUtf8EncodedCssWebResourceResponse(InputStream data) {
              return new WebResourceResponse("text/css", "UTF-8", data);
          }
      });
  
      mWebView.loadUrl("http://www.example.com/Mobile/mob/aa.html");
  }
  </code></pre>
  
  <p>css file:</p>
  
  <pre><code>body{background:url('tamil.jpg');}
  h1{color:#cfc;}
  </code></pre>