views:

56

answers:

1

Launching a Streetview intent for a location doesn't guarantee that a Streetview exists for that location. If the Streetview doesn't exist, the user just sees a black screen that spins. Is there a way to programmatically check if it exists before launching the Streetview intent?

A: 

Use PackageManager and queryIntentActivities() with your Intent. If you get back a list of 0 matching activities, you know nothing on the device will handle your request.

CommonsWare
This won't let me know if there is an actual panorama available at a given location will it? As far as I see it will only tell me whether the StreetView activity exists. On devices with StreetView activity, I wind up with a black screen and a spinner that doesn't give any indication that a panorama exist for that geopoint. The Streetvew activity is still launched correctly though. I can query the above URL above to discover that data actually exists before launching the Activity via intent. There is no streetViewExists(Geopoint p) or some such function is there?
Osmund
@Osmund: Whoops, sorry, I thought your concern was whether Streetview itself was available. There is no means to determine if a street view exists.
CommonsWare