On Wed, Jun 27, 2012 at 11:40 AM, Simon Giddings
<[email protected]> wrote:
> In my activity I need to be able to query if the following services are
> available :
>
> phone call
> email
> internet browsing
>
> This is to ensure that I only provide these options when they exist on the
> device.
> For example, phone calls are not normally available on a tablet.
>
> Can this be done ?

That depends on what you mean. These are not "services" -- they are
applications. And, more importantly, they have activities which
represent the user interface.

So, if you want to know if, say, an ACTION_DIAL Intent on a tel: Uri
will work, create an Intent for it and call resolveActivity() on
PackageManager. If it returns null, you know that a startActivity()
call will fail on that same Intent.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.7 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to