Android file extension from a URI

To get a file’s extension from a URI in Android, you can use the ContentResolver and DocumentFile classes. Here’s an example of how you can achieve this: n this example, getFileExtension takes a Context and a Uri as parameters and returns the file extension. It first tries to get the file extension from the MIME…

continue reading
No Comments