![]() String fileExtension = MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString()) Uri selectedUri = Uri.fromFile(file.getAbsoluteFile()) Note that this approach will not anycodings_android find activities that filter for all file anycodings_android mime types when uri is a directory. This still anycodings_android works to match activities that filter anycodings_android for scheme âÂÂfileâ anycodings_android but no specific mime type, i.e. The file extension and mime anycodings_android type for folder's uri ends up being null anycodings_android in the code snippet below. I find this also works well to open anycodings_android either file or folder depending on anycodings_android extension. Uri uri = Uri.parse("file:///sdcard/MyFolder") ![]() Intent intent = new Intent(Intent.ACTION_VIEW) Just set anycodings_android the data to your folder's Uri. ![]() ![]() Because files that are directories don't anycodings_android seem to have a standard mime type, I anycodings_android coded my file explorer to filter for anycodings_android intents without a mime type. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |