i converted website into app using webview. but website background is not appearing in my app

Stack Overflow Asked by Neha Bhosale on January 13, 2021

public class MainActivity extends AppCompatActivity {
    private WebView mywebview;

    protected void onCreate(Bundle savedInstanceState) {
        mywebview = (WebView) findViewById(;
        mywebview.setWebViewClient(new WebViewClient());
        WebSettings webSettings = mywebview.getSettings();
    public void onBackPressed() {
        if (mywebview.canGoBack()) {
        } else {

2 Answers

If you mean the background image with the elephant statue that we see on is not loading: this is probably because Android requires all requests to use HTTPS by default from target API level 28 onwards.

The background image, however, is specified as plain HTTP: The server immediately redirects it to HTTPS, but because the HTTP request is blocked, the WebView cannot know that (and even if it did, it would be insecure to use it anyway). You can also see this in a regular web browser, which should show some kind of warning text or icon in the address bar.

So the best way to fix this is to simply change the website to use HTTPS throughout.

If you absolutely, positively cannot do that, you can use <application android:usesClearTextTraffic="true"> in your manifest (documentation). But for the security of your users, please consider this a last resort.

Answered by Thomas on January 13, 2021

Remove following...


from XMl:


Answered by chand mohd on January 13, 2021

Add your own answers!

Related Questions

SQL Query [Count the result of a query]

0  Asked on February 3, 2021 by abdelhalim


function stops when fetch() fails

2  Asked on February 2, 2021 by uncannyorange


merging lists of dataframes in R effectively

1  Asked on February 2, 2021 by user5813583


The Math behind a tesorflow.tensordot()

0  Asked on February 1, 2021 by harsh-dhamecha


How to check if a word contains one letter from another string

3  Asked on February 1, 2021 by umar-zahid


How to use citeproc-java on Android

1  Asked on February 1, 2021 by hector


Laravel whereHas Filter sub relation

1  Asked on February 1, 2021 by bryant-tang


How to check if list contains dict element with same key

1  Asked on February 1, 2021 by radosaw-hryniewicki


react-navigation nested drawer items

1  Asked on February 1, 2021 by caner-akmak


Add a header to an outgoing request by a filter in WebFlux

1  Asked on February 1, 2021 by jae-young-lee


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir