title: Android studio hide white screen flash on every page load
body: <p>I am developing an app that uses local files.
  In index.html file i have multiple links to different local files like: settings.html, add.html, edit.html and ...
  Problem is when i run app in android studio and smart phone, when i click on any link, before loading content a fast screen flash with white background shows up.
  Look at this gif:</p>
  <p><a href="https://i.stack.imgur.com/5clTP.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5clTP.gif" alt="enter image description here" /></a></p>
  <p>How can i disable this white flash?</p>
  <p>MainActivity.java:</p>
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      WebView webView=findViewById(R.id.webView);
      webView.getSettings().setJavaScriptEnabled(true);
      webView.getSettings().setDomStorageEnabled(true);
      webView.loadUrl(&quot;file:///android_asset/index.html&quot;);
  
      getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  }
  </code></pre>
  <p>activity_main.xml:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout
  xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
  xmlns:tools=&quot;http://schemas.android.com/tools&quot;
  android:layout_width=&quot;match_parent&quot;
  android:layout_height=&quot;match_parent&quot;
  tools:context=&quot;.MainActivity&quot;&gt;
  
  &lt;WebView
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:id=&quot;@+id/webView&quot;/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>