android - Issue with StorageAccessFramework and DownloadManager -


I have a problem I am developing some streaming / video download app. I am using video downloads.

To save the request, the user has to offer the destination (SD card or internal phone memory) to choose.

I have problems with Lollipop and DownloadManager.

I want to store the files to download select user'm User offer:

  effect intended = new intention (intention. Akshn_opiaandiosiiimititii); StartActivityForResult (intent, REQUEST_CODE_FOR_DESTINATION);  

And onActivityResult I'm getting it through

  Uri treeUri = data.getData (); Documentfile destinationdiru = documentfile Setriuri (this, padouri);  

Now, I need to set DownloadManager.Request as the destination Destination

  request = new DownloadManager.Request (Uri.parse (getDownloadUrl ())); Request.setTitle (downloadInfo.getTitle ()); Request.allowScanningByMediaScanner (); Request.setNotificationVisibility (DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); Request.setDestinationUri (destinationDirUri);  

"Download / video after selecting" directory, and

  DownloadManager downloadManager = (DownloadManager) getSystemService (Context.DOWNLOAD_SERVICE); DownloadManager.enqueue (request);  

I am getting it

  E / RecordDownloader: error / system while retrieving InfoS. Er: JavaklangkIllegalArgumentException: No files URI: Material: //com.android.externalstorage.documents/tree/primary%3ADownload%2Fvideo W / System.err: and android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java : 167) W / Systems Er: Android Debate .DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:137) W / System.Arr: Android Content. CONTRACT PROVIDER PROXY. INSTITUTE (Content Pivariative Java .75) W / Systems. Arः Android Kansentkkantentrolvrkinsrt (Kantentrsolvrkjawa) 1207) w / Sistm.aarar: Android.apikdaunlodmanejr.ankveyu (Daunlodmanejrkjawaः 9 46) W / Sistm.aarar on Ckteleboykdaunlod. RecordDownloader.exquaDownYuVest (Record Donalder. Java2) W / System .ER: ch.teleboy.download.Record Downloader.access $ 300 (RecordDownloader.java:48) W / System. Er: at ch.teleboy.download.RecordDownloader $ DownloaderTask.run (RecordDow Nloader.java191) w / System.err: at java.lang.Thread.run (Thredkjawa: 818)  
< P> If I try to write some files at the selected location, then it works.

document file newFile = destinationDirUri.createFile ("text / plain", "test.txt"); OutputStream Out = getContentResolver () OpenOutputStream (newFile.getUri ()); Out.written ("Some Dummy Lessons ...". GetBytes ()); Out.close ()

Any suggestions?


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -