Android Question Read the file type from the content chooser

DonManfred

Expert
Licensed User
Longtime User
You send the filename? Why you need it then later. Just use your stored value!?
Where did you "send" it?

Maybe i did not understand the problem. I´m not talking about the fact that in some cases the path is not available.

To check the content i would suggest to read the first bytes (dont know how much)... Maybe you can see the content in the first bytes. A zip for ex. does have a special header (also a lot of other files)...

A zip file for ex. starts with PK\x03\x04
A PDF with %PDF


Additionally:
You can search for all files by yourself (see for ex my wildcard-class). you can check the extention on all found files easyly
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
When i run my class over my external sdcard i get ALL files (not files from other apps) on my sdcard with the class.
Dont use my class with a path from content-chooser!

Use a real path on your device and scan this folder like you would do it with File.Listfiles
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…