In my Android app, I launch a document chooser so the user can import some documents into my app:
this.intentlauncherchoosedoc = this.registerForActivityResult(
new ActivityResultContracts.OpenMultipleDocuments(),
new ActivityResultCallback<List<Uri>>() {
@Override
public void onActivityResult(List<Uri> urilist) {
for (Uri uri : urilist) {
String filename = uri.getLastPathSegment();
createdoc(uri, filename);
}
}
}
);
Unfortunately, when the user choose a document, the uri that comes back looks like this:
content://com.google.android.apps.docs.storage/document/acc=1;doc=encoded=mgMyynWh7Lrq1qW1dradGc60EJWehheCQiS5mYY7a8CF80Ouzro=
Is there any way to get the original filename of the document that was chosen, so that I can save that filename and list it to my user when they are reviewing their imported docs?