In my application I want to download a file and view it. The issue is that I need to check whether there is any third party application installed on the device that can open the file format(Mime) before it is downloaded. Is this possible?
Create an ACTION_VIEW
Intent
with the right MIME type and a fake path to the file (or, better yet, the path you intend to download it to). Then, use PackageManager
and queryIntentActivities()
-- if you get back a list with 1+ items in it, then startActivity()
on that Intent
will succeed once you have downloaded the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With