title: Accessing phones storage in an app developed using webview
body: <p>I have converted a website to an app using webview where I need to access the images and files from the phone's storage. I tried adding <code>READ_EXTERNAL_STORAGE</code> and <code>WRITE_EXTERNAL_STORAGE</code> but it doesn't work.<a href="https://i.stack.imgur.com/NmCvZ.jpg" rel="nofollow noreferrer">button to access the storage is browse</a></p>
  <p>here is my <code>MainActivity.java</code> code</p>
  <pre><code>import androidx.appcompat.app.AppCompatActivity;                      
  import android.os.Bundle;                                                
  import android.webkit.WebSettings;                                      
  import android.webkit.WebView;                                        
  import android.webkit.WebViewClient;                                       
                                                                                 
  public class MainActivity extends AppCompatActivity {                          
      private WebView mywebview;                                                 
                                                                                 
      @Override                                                                  
      protected void onCreate(Bundle savedInstanceState) {                       
          super.onCreate(savedInstanceState);                                    
          setContentView(R.layout.activity_main);                                
          mywebview = (WebView) findViewById(R.id.webview);                      
          WebSettings webSettings = mywebview.getSettings();                     
          webSettings.setJavaScriptEnabled(true);                                
          mywebview.loadUrl(&quot;https://www.google.com&quot;);                           
          mywebview.setWebViewClient(new WebViewClient());                       
      }                                                                          
                                                                                 
      @Override                                                                  
      public void onBackPressed() {                                            
          if (mywebview.canGoBack()) {                                            
              mywebview.goBack();                                                
          } else {                                                               
              super.onBackPressed();                                             
          }                                                                      
      }                                                                          
  }
  </code></pre>
  <p><code>AndroidManifest.xml</code> file is here</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;
  
  
  &lt;application
      android:allowBackup=&quot;true&quot;
      android:icon=&quot;@mipmap/ic_launcher&quot;
      android:label=&quot;@string/app_name&quot;
      android:roundIcon=&quot;@mipmap/ic_launcher_round&quot;
      android:supportsRtl=&quot;true&quot;
      android:theme=&quot;@style/AppTheme&quot;&gt;
      &lt;activity android:name=&quot;.MainActivity&quot;&gt;
          &lt;intent-filter&gt;
              &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
              &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>kindly suggest a solution.</p>