我以前是文件提供者,将视频从另一个应用程序共享到我的应用程序。.我具有uri值,但是我无法从uri中获取文件名
if (receivedAction != null) {
if (receivedAction.equals(Intent.ACTION_SEND)) {
//content is being shared
if (receivedType.startsWith("text/")) {
//handle sent text
} else if (receivedType.startsWith("video/")) {
//handle sent image
Uri receivedUri = (Uri) receivedIntent.getParcelableExtra(Intent.EXTRA_STREAM);
if (receivedUri != null) {
String datas = null;
try {
uri = getFilePath(this, receivedUri);
} catch (URISyntaxException) {
e.printStackTrace();
}
}
}
}
}