tags:

views:

95

answers:

2

Hello, everybody! I have such a demand, need to call in the program Google Maps software, if I use the following method call to map:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:" + restaurant.getLatitude() + "," + restaurant.getLongitude() + "?q=" + s));
startActivity(intent);

So that I can successfully call the Google Maps software, but if there are multiple maps when the system software, using the above approach will pop up for users to choose to display the map software, I now need to do is have more than one map even if the system software, But every time I call the Google Maps software to display. I ask how you can do, thanks! bythe way, Google Maps software is open source? In the android source code is not found maps related to the source code, where you can come?

I can successful invoke google map,but if android system have mutil map apps,system will propmt user to select which map app

+1  A: 

But every time I call the Google Maps software to display. I ask how you can do

If you absolutely need Google Maps, add a MapActivity to your application.

bythe way, Google Maps software is open source?

No.

I can successful invoke google map,but if android system have mutil map apps,system will propmt user to select which map app

If the user installed a second map application, perhaps they want to use it. Please do not interfere.

CommonsWare
A: 

Thank for CommonsWare and Oded for answers,but i have some doubts.

If you absolutely need Google Maps,add a MapActivity to your application.

if I extends MapActivity,there is no software like Google Maps as a number of menu options and navigation.

If the user installed a second map application, perhaps they want to use it. Please do not interfere.

In accordance with the logic you say is correct, but in some other applications have this feature I have seen, that there are multiple maps if the phone software will not pop up for users to choose but a direct call to the Google Maps software . I would like is not available through other settings to filter out other map software? For example,

intent.AddCategory (String category) or intent.setPackage (String packageName)

1. You should have posted this as a comment on CommonsWare's answer. 2. If other apps are overriding user defaults, that is bad. Please don't do that. If you simply hardcode the Google Maps intents into your app, you can also cause problems on devices that may not have it installed.
Christopher