3

Currently, I let user pick a zip file by using

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("application/zip");
startActivityForResult(intent, RequestCode.REQUEST_CHOOSE_BACKUP_FILE);

In onActivityResult, we are getting Uri through data.getData()

I'm using Paul Burke's code, to resolve Uri to full file path.

It works well till I use a 3rd party Explorer (You can see the blue file cabinet icon. The app name is Explorer)

enter image description here

An example of returned Uri is content://com.speedsoftware.rootexplorer.content/storage/emulated/0/Download/epayslip-2.zip , if I select a file through Explorer.

By using Paul Burke's code, getDataColumn will be executed, which it will eventually return null.

I was wondering, is this caused by shortcoming of Paul Burke's code, or the problem is lied on the implementation of 3rd party file explorer app? Is it possible that we can fix it?

Community
  • 1
  • 1
Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875

0 Answers0