payload: {"action":"closed","issue":{"url":"https://api.github.com/repos/Blankj/AndroidUtilCode/issues/972","repository_url":"https://api.github.com/repos/Blankj/AndroidUtilCode","labels_url":"https://api.github.com/repos/Blankj/AndroidUtilCode/issues/972/labels{/name}","comments_url":"https://api.github.com/repos/Blankj/AndroidUtilCode/issues/972/comments","events_url":"https://api.github.com/repos/Blankj/AndroidUtilCode/issues/972/events","html_url":"https://github.com/Blankj/AndroidUtilCode/issues/972","id":463517211,"node_id":"MDU6SXNzdWU0NjM1MTcyMTE=","number":972,"title":" UriUtils.file2Uri使用上一个奇怪的问题","user":{"login":"houyuehai","id":19543209,"node_id":"MDQ6VXNlcjE5NTQzMjA5","avatar_url":"https://avatars1.githubusercontent.com/u/19543209?v=4","gravatar_id":"","url":"https://api.github.com/users/houyuehai","html_url":"https://github.com/houyuehai","followers_url":"https://api.github.com/users/houyuehai/followers","following_url":"https://api.github.com/users/houyuehai/following{/other_user}","gists_url":"https://api.github.com/users/houyuehai/gists{/gist_id}","starred_url":"https://api.github.com/users/houyuehai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houyuehai/subscriptions","organizations_url":"https://api.github.com/users/houyuehai/orgs","repos_url":"https://api.github.com/users/houyuehai/repos","events_url":"https://api.github.com/users/houyuehai/events{/privacy}","received_events_url":"https://api.github.com/users/houyuehai/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-07-03T02:46:47Z","updated_at":"2019-07-26T15:27:09Z","closed_at":"2019-07-26T15:27:09Z","author_association":"NONE","body":"## Describe the bug\r\n我创建一个excel文件，放在外部存储中。\r\n然后在应用内分享打开这个文件。\r\n问题就在，app安装完成**_第一次_**调用这个方法选择其他的app打开这个文件的时候，会提示找不到这个文件。只有第一次，只要不卸载，之后创建新的文件正常打开。\r\n我用阿里华为的远端测试机好像没有这个问题（因为我忘记了是华为哪一个手机了，这好像是小米适配的问题）\r\n    public static boolean openFile(File file) {\r\n        Intent openIntent = new Intent(Intent.ACTION_VIEW);\r\n        openIntent.addCategory(Intent.CATEGORY_DEFAULT);\r\n        String name = file.getName().trim();\r\n        String extension = name.substring(name.lastIndexOf('.') + 1);\r\n        String type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);\r\n        _**Uri uri = UriUtils.file2Uri(file);**_\r\n        openIntent.setDataAndType(uri, type);//此处可发送多种文件\r\n        openIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n        openIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\r\n        openIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\r\n        if (Utils.getApp().getPackageManager().queryIntentActivities(openIntent, PackageManager.MATCH_DEFAULT_ONLY).size() > 0) {\r\n            ActivityUtils.startActivity(Intent.createChooser(openIntent, file.getName()));\r\n            return true;\r\n        }\r\n        return false;\r\n    }\r\n\r\n版本:1.24.3\r\n手机：小米mx6 android N\r\n感谢柯基。"}}
other: {"actor":{"display_login":"Blankj"}}