title: DocumentPicker in React-Native not working properly for Android devices
body: <p>I have implemented a document picker in my react native application and it is working fine for iOS. However in Android, I am having a weird issue</p>
  <p>When I open the document picker and the navigation takes to the file explorer (Downloads section) in Android phone, though I am able to select the pdf file but, when it comes to the application back, it stuck to the page and the file is not there. I have attached the screenshot Same behaviour when the file explorer takes to the recent files. Only when from the recent files, I select the google drive and try to select the pdf from there, it works as expected and I can see the file in my application and the app do not stuck.</p>
  <p>Here is what I have written for the pdf document picker</p>
  <pre><code>selectPDF = async ()=&gt;{
  
        
          var imageList = [...this.state.files];
  
  
          try {
              const results = await DocumentPicker.pickMultiple({
              type: [DocumentPicker.types.pdf],
              });
              for (const res of results) {
  
                      console.log(
                          res.uri,
                          res.type, // mime type
                          res.name,
                          res.size
                      );
  
                      const fileName = res.uri.replace(&quot;file://&quot;,&quot;&quot;);
                      let data1 = ''
                      RnFetchBlob.fs.readStream(
                          fileName,
                          'base64',
                          4095
                      )
                      .then((ifstream)=&gt;{
                          //let data1 = ''
                          ifstream.open()
                          ifstream.onData((data)=&gt;{
                              data1 += data;
  
  
                          })
  
                          ifstream.onEnd(() =&gt; {
                             
                              let base64 = data1
                     
                                                       
                              imageList.push({
                                  imageName:res.name,
                                  image:base64,
                                  mime:res.type,
                                  size:res.size
                              })
  
                              this.setState({
                                  ...this.state,
                                  openCamera:false,
                                  lastFileName:imageList[imageList.length - 1].imageName,
                                  files:imageList
                              })
  
                          })
                      })
  
  
  
              }
          } catch (err) {
              if (DocumentPicker.isCancel(err)) {
                      this.closeModal();
              } else {
              throw err;
              }
          }
      }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/SyILi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SyILi.png" alt="enter image description here" /></a>
  Can anyone throw some light as to what I may be missing. Is some configuration needs to be set on device level or any other thing.</p>