title: WebView is not showing image
body: <p>I have this website that is showing 'T-shirt' in browser and in other webviews etc, but I need it to be shown in this particular code. All others things are good except this image is not showing. So now I want it show this T-Shirt picture when the page is loaded. </p>
  
  <p>MainActivity:</p>
  
  <pre><code>   public class MainActivity extends Activity {
         int count = 0;
         private ValueCallback&lt;Uri&gt; mUploadMessage;
         public ValueCallback&lt;Uri[]&gt; uploadMessage;
         public static final int REQUEST_SELECT_FILE = 100;
         private final static int FILECHOOSER_RESULTCODE = 1;
         private int contador;
         private WebView webView;
  
  
  
         private ProgressBar progressBar;
         private ProgressBar progressBar2;
         private boolean firstTime;
         //private InterstitialAd mInterstitialAd;
         @Override
         protected void onCreate(Bundle savedInstanceState) {
          contador = 0;
          super.onCreate(savedInstanceState);
  
          setContentView(R.layout.splash_screen);
          checkAndRequestPermissions();
          //please leave it to me
  
  
          firstTime = true;
  
          if (checkConnectivity()) {
  
              progressBar = (ProgressBar) findViewById(R.id.progressBar1);
  
              webView = new WebView(this);
  
              webView.getSettings().setLoadWithOverviewMode(true);
              webView.getSettings().setBuiltInZoomControls(true);
              webView.getSettings().setSupportZoom(true);
  
              webView.getSettings().setJavaScriptEnabled(true);
              webView.getSettings().setJavaScriptEnabled(true);
              webView.getSettings().setAllowFileAccess(true);
              webView.getSettings().setDomStorageEnabled(true);
  
             webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
              webView.getSettings().setDatabaseEnabled(true);
              webView.getSettings().setDomStorageEnabled(true);
              webView.getSettings().setAppCacheEnabled(true);
  
  
  
  
  
  
            webView.getSettings().
            setLayoutAlgorithm(webView.getSettings().getLayoutAlgorithm().NORMAL);
              webView.setSoundEffectsEnabled(true);
              webView.setKeepScreenOn(true);
              if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.JELLY_BEAN) {
                  webView.getSettings().setAllowUniversalAccessFromFileURLs(true);
              }
              webView.getSettings().setLoadsImagesAutomatically(true);
              webView.getSettings().setJavaScriptEnabled(true);
              webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
              webView.getSettings().setBuiltInZoomControls(true);
  
              webView.setWebViewClient(new WebViewClient() {
  
  
  
              public boolean shouldOverrideUrlLoading(WebView view, String url) {
                        if (contador == 999) {
                         loadInterstitial();
                          contador = 0;
                         } else {
                            contador++;
                        }
  
                      progressBar2.setProgress(0);
                      progressBar2.setVisibility(View.VISIBLE);
                      view.loadUrl(url);
  
                      return true;
  
                  }                       //wait ok i try now again
  
                  public void onPageFinished(WebView view, String url) {
  
                      if (url.equals(getResources().getString(R.string.web_url))
                              &amp;&amp; firstTime) {
                          firstTime = false;
  
                          setContentView(R.layout.activity_main);
  
                          progressBar2 = (ProgressBar) 
                findViewById(R.id.progressBar2);
                          progressBar2.setVisibility(View.GONE);
  
                         /* adView = (AdView) findViewById(R.id.adView);
                          adView.setVisibility(View.GONE);
                          adView.setAdListener(new AdListener() {
                              public void onAdLoaded() {
                                  adView.setVisibility(View.VISIBLE);
                              }
                          });
                          AdRequest adRequest = new AdRequest.Builder().build();
                          adView.loadAd(adRequest);
                          mInterstitialAd.loadAd(adRequest);*/
  
                          FrameLayout fl = (FrameLayout) findViewById(R.id.webView1);
                          fl.addView(webView);
  
                          webView.setWebChromeClient(new WebChromeClient() {
                              protected void openFileChooser(ValueCallback uploadMsg, String acceptType)
                              {
                                  mUploadMessage = uploadMsg;
                                  Intent i = new Intent(Intent.ACTION_GET_CONTENT);
                                  i.addCategory(Intent.CATEGORY_OPENABLE);
                                  i.setType("image/*");
                                  startActivityForResult(Intent.createChooser(i, "File Browser"), FILECHOOSER_RESULTCODE);
                              }
  
  
                              // For Lollipop 5.0+ Devicesdo
                              @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
                              public boolean onShowFileChooser(WebView mWebView, 
           ValueCallback&lt;Uri[]&gt; filePathCallback, 
           WebChromeClient.FileChooserParams fileChooserParams)
                              {
                                  if (uploadMessage != null) {
                                      uploadMessage.onReceiveValue(null);
                                      uploadMessage = null;
                                  }
  
                                  uploadMessage = filePathCallback;
  
                                  Intent intent = 
         fileChooserParams.createIntent();
                                  try
                                  {
                                      startActivityForResult(intent, 
           REQUEST_SELECT_FILE);
                                  } catch (ActivityNotFoundException e)
                                  {
                                      uploadMessage = null;
                                      Toast.makeText(getApplicationContext(), 
          "Cannot Open File Chooser", Toast.LENGTH_LONG).show();
                                      return false;
                                  }
                                  return true;
                              }
  
                              //For Android 4.1 only
                              protected void openFileChooser(ValueCallback&lt;Uri&gt; 
         uploadMsg, String acceptType, String capture)
                              {
                                  mUploadMessage = uploadMsg;
                                  Intent intent = new 
        Intent(Intent.ACTION_GET_CONTENT);
                                  intent.addCategory(Intent.CATEGORY_OPENABLE);
                                  intent.setType("image/*");
  
       startActivityForResult(Intent.createChooser(intent, "File Browser"), FILECHOOSER_RESULTCODE);
                              }
  
                              protected void openFileChooser(ValueCallback&lt;Uri&gt; uploadMsg)
                              {
                                  mUploadMessage = uploadMsg;
                                  Intent i = new Intent(Intent.ACTION_GET_CONTENT);
                                  i.addCategory(Intent.CATEGORY_OPENABLE);
                                  i.setType("image/*");
                                  startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE);
                              }
                              @Override
                              public void onProgressChanged(WebView view,
                                                            int newProgress) {
                                  progressBar2.setProgress(newProgress);
                                  if (newProgress == 100) {
                                      Handler handler = new Handler();
                                      handler.postDelayed(new Runnable() {
                                          public void run() {
                                              progressBar2
                                                      .setVisibility(View.GONE);
                                          }
                                      }, 0);
  
                                  } else {
                                      progressBar2.setVisibility(View.VISIBLE);
                                  }
                              }
                          });
  
                      }
  
                  }
  
              });
  
              webView.setWebChromeClient(new WebChromeClient() {
  
                  @Override
                  public void onProgressChanged(WebView view, int newProgress) {
                      progressBar.setProgress(newProgress);
  
                  }
              });
  
              webView.loadUrl(getResources().getString(R.string.web_url));
  
          } else {
              AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this);
              dlgAlert.setMessage("Please connect to internet and try again.");
              dlgAlert.setTitle("Connection problem");
              dlgAlert.setOnCancelListener(new DialogInterface.OnCancelListener() {
                  public void onCancel(DialogInterface dlg) {
                      finish();
                  }
              });
  
              dlgAlert.setPositiveButton("Retry",
                      new DialogInterface.OnClickListener() {
  
                          @Override
                          public void onClick(DialogInterface dialog, int which) {
                              // TODO Auto-generated method stub
                              Intent i = new Intent(MainActivity.this,
                                      MainActivity.class);
                              startActivity(i);
                              finish();
  
                          }
  
                      });
              dlgAlert.setNegativeButton("Cancel",
                      new DialogInterface.OnClickListener() {
  
                          @Override
                          public void onClick(DialogInterface dialog, int which) {
                              // TODO Auto-generated method stub
                              finish();
  
                          }
  
                      });
              dlgAlert.create().show();
  
          }
  
      }
  
      public void onBackPressed() {
          if (webView.copyBackForwardList().getCurrentIndex() &gt; 0) {
              webView.goBack();
              count++;
              if (count == 999) {
              //    if (mInterstitialAd.isLoaded()) {
                      //mInterstitialAd.show();
                //      count=0;
                  //}
              }
          } else {
              super.onBackPressed();
          }
  
      }
  
      @Override
      public void onResume() {
  
          super.onResume();
  
      }
  
      public void requestNewInterstitial() {
          //AdRequest adRequest = new AdRequest.Builder().build();
          //mInterstitialAd.loadAd(adRequest);
      }
  
      public void loadInterstitial() {
        //  if (mInterstitialAd.isLoaded()) {
          //    mInterstitialAd.show();
          //} else {
            //  Toast.makeText(MainActivity.this, "Not loaded", Toast.LENGTH_LONG).show();
          //}
      }
      private  boolean checkAndRequestPermissions() {
  
  
          int externalstoragepermission= ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);
          int writesoragepermission=ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
          //]int readphonestatepermission= ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE);
  
  
          List&lt;String&gt; listPermissionsNeeded = new ArrayList&lt;&gt;();
  
          if (externalstoragepermission != PackageManager.PERMISSION_GRANTED) {
              listPermissionsNeeded.add(Manifest.permission.READ_EXTERNAL_STORAGE);
          }
  
          if (externalstoragepermission != PackageManager.PERMISSION_DENIED)
          {
              listPermissionsNeeded.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
          }
  
  
          /*if (camerapermission!= PackageManager.PERMISSION_GRANTED) {
              listPermissionsNeeded.add(Manifest.permission.CAMERA);
          }
          if (readphonestatepermission!= PackageManager.PERMISSION_GRANTED) {
              listPermissionsNeeded.add(Manifest.permission.READ_PHONE_STATE);
          }
         */
  
          if (!listPermissionsNeeded.isEmpty()) {
              ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]),111);
              return false;
          }
          return true;
      }
  
      @Override
      public void onActivityResult(int requestCode, int resultCode, Intent intent)
      {
          if(Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.LOLLIPOP)
          {
              if (requestCode == REQUEST_SELECT_FILE)
              {
                  if (uploadMessage == null)
                      return;
                  uploadMessage.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
                  uploadMessage = null;
              }
          }
          else if (requestCode == FILECHOOSER_RESULTCODE)
          {
              if (null == mUploadMessage)
                  return;
              // Use MainActivity.RESULT_OK if you're implementing WebView inside Fragment
              // Use RESULT_OK only if you're implementing WebView inside an Activity
              Uri result = intent == null || resultCode != MainActivity.RESULT_OK ? null : intent.getData();
              mUploadMessage.onReceiveValue(result);
              mUploadMessage = null;
          }
          else
              Toast.makeText(getApplicationContext(), "Failed to Upload Image", Toast.LENGTH_LONG).show();
      }
      public boolean checkConnectivity() {
          ConnectivityManager conMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
          NetworkInfo i = conMgr.getActiveNetworkInfo();
          if (i == null)
              return false;
          if (!i.isConnected())
              return false;
          if (!i.isAvailable())
              return false;
          return true;
      }
  
      }
  </code></pre>
  
  <p>And my splash.xml is:</p>
  
  <pre><code>        &lt;ImageView
          android:id="@+id/cargando"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:contentDescription="@string/app_name"
          android:scaleType="fitXY"
          android:src="@drawable/splashscreenimage" /&gt;
  
  
  
           &lt;ProgressBar
          android:id="@+id/progressBar1"
          android:layout_width="200dp"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_centerHorizontal="true"
          android:layout_marginBottom="58dp"
          style="?android:attr/progressBarStyleHorizontal"
          /&gt;
  
         &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>and main.xml is:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:ads="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      tools:context="com.example.khanzadakhan.pforpractice.MainActivity"&gt;
  
  
      &lt;FrameLayout
          android:id="@+id/webView1"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_weight="1" /&gt;
  
      &lt;ProgressBar
          android:id="@+id/progressBar2"
          style="?android:attr/progressBarStyleHorizontal"
          android:layout_width="fill_parent"
          android:layout_height="3dp"
          android:max="100"
          android:visibility="gone" /&gt;
  
  
          &lt;/LinearLayout&gt;
  </code></pre>