Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 我要转换';内容://0@media/外部/file/147';到file:///storage/sdcard0/files/X.pdf`在android中? urifileuri=getIntent().getData(); 如果(!fi_Java_Android - Fatal编程技术网

Java 我要转换';内容://0@media/外部/file/147';到file:///storage/sdcard0/files/X.pdf`在android中? urifileuri=getIntent().getData(); 如果(!fi

Java 我要转换';内容://0@media/外部/file/147';到file:///storage/sdcard0/files/X.pdf`在android中? urifileuri=getIntent().getData(); 如果(!fi,java,android,Java,Android,我要转换';内容://0@media/外部/file/147';到file:///storage/sdcard0/files/X.pdf`在android中? urifileuri=getIntent().getData(); 如果(!fileUri.getPath()包含(“外部”)和&fileUri.getScheme().equals(“内容”)){ Cursor Cursor=getContentResolver().query(fileUri,null,null,nul

我要转换';内容://0@media/外部/file/147';到file:///storage/sdcard0/files/X.pdf`在android中?
urifileuri=getIntent().getData();
如果(!fileUri.getPath()包含(“外部”)和&fileUri.getScheme().equals(“内容”)){
Cursor Cursor=getContentResolver().query(fileUri,null,null,null,null);
试一试{
if(cursor!=null&&cursor.moveToFirst()){
fileName=cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
}
}最后{
cursor.close();
}
}如果(!fileUri.getPath()包含(“外部”)和&fileUri.getScheme().equals(“文件”)){
List pathSegments=fileUri.getPathSegments();
如果(pathSegments.size()>0){
fileName=pathSegments.get(pathSegments.size()-1);
}
}
Uri fileUri = getIntent().getData();
        if (!fileUri.getPath().contains("external") && fileUri.getScheme().equals("content")) {
            Cursor cursor = getContentResolver().query(fileUri, null, null, null, null);
            try {
                if (cursor != null && cursor.moveToFirst()) {
                    fileName = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
                }
            } finally {
                cursor.close();
            }
        }if (!fileUri.getPath().contains("external") && fileUri.getScheme().equals("file")) {
            List<String> pathSegments = fileUri.getPathSegments();
            if (pathSegments.size() > 0) {
                fileName = pathSegments.get(pathSegments.size() - 1);
            }
        }