can Anyone help me in asking run time permission for WRITE_External_STORAGE when i m downloading a file from my application.? : can Anyone help me  in asking run time permission for WRITE_External_STORAGE when i m downloading a file from my application.? Using my webview in android which display my website that i have pdf files in that so i require runtime permission to allow storage access in my app..

Here is my sample code:

          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("https://learntatatrusts.org/");
          myWebView.setWebViewClient(new WebViewClient());
          myWebView.setDownloadListener(new DownloadListener() {

            public void onDownloadStart(String url, String userAgent, String 
            contentDisposition, String mimetype, long contentLength) {


                DownloadManager.Request request = new 
                DownloadManager.Request(Uri.parse(url));

                CookieManager cookieManager = CookieManager.getInstance();
                String cookie = 
                cookieManager.getCookie("https://learntatatrusts.org/");
                request.addRequestHeader("Cookie", cookie);
                request.allowScanningByMediaScanner();
                Environment.getExternalStorageDirectory();
                getApplicationContext().getFilesDir().getPath(); //which returns 
                the internal app files directory path
                
                request.setNotificationVisibility(DownloadManager.Request.
                VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
                request.setDestinationInExternalPublicDir(Environment.
                DIRECTORY_DOWNLOADS, "download");
                DownloadManager dm = (DownloadManager) 
                getSystemService(DOWNLOAD_SERVICE);
                dm.enqueue(request);
            }

            });
         }
        @Override
        public void onBackPressed() {
        if(myWebView.canGoBack()) {
            myWebView.goBack();
        } else {
            super.onBackPressed();
          }
          }
        }