How to find the name and type of executable file

On an Android phone, we execute the file using another application, such as a video player, audio player, PDF reader, etc.
How can I get the name and file type for a file that just executes from the application this way?
When we open a file in Windows Explorer, the file name is written by the operating system. Some names are saved in the Recent folder.
Is there any similar option in android that can provide me with the name of the executable?

+3
source share
1 answer

you can find the file type using the file extension or using the method below

ContentResolver cR = context.getContentResolver();
MimeTypeMap mime = MimeTypeMap.getSingleton();
String type = mime.getExtensionFromMimeType(cR.getType(uri));
+1
source

All Articles