문제

I am interested in opening the Google Navigator app from inside an application I am writing. I want to be able to spawn it at a given time and pass specific data into it.

Can anyone think of a good way for me to do this? What permissions do I need, etc? Thank you very much.

도움이 되었습니까?

해결책

You are looking for intents. These are messages you throw up to the system that allow the appropriate action to be taken, such as opening another application.

Here is a guide to using Intents and Intent Filters.

In particular, here is a page that discusses the intents you should use for Google's applications, including Google Maps.

Also, see here for a similar question asked on Google's forum.

A sample of example code that works is as follows:

Intent i = new Intent(Intent.ACTION_VIEW, 
Uri.parse("google.navigation:q=New+York+NY)); 
startActivity(i); 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top