I have developed application which need to use any PDF-Viewer. How can I programatically check the existence of application which are able to respond to my Intent?
Asked
Active
Viewed 75 times
0
-
I would recommend using the solution from [here][1]. [1]: http://stackoverflow.com/questions/2883355/how-to-render-pdf-in-android/ – coder Jan 18 '12 at 19:00
-
1Possible duplicate. Look at this [answer](http://stackoverflow.com/a/2885744/617996). – PrimosK Jan 18 '12 at 19:00
1 Answers
0
This post in the Android Developers blog describes how to test for an Intent receiver without actually trying to send the Intent.
As a teaser, here's the important part of the code. You should read the blog post for more details and a complete function that you can copy and paste.
List<ResolveInfo> list =
packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
return list.size() > 0;

Sparky
- 8,437
- 1
- 29
- 41