I'm creating an app which obtains users location and location of various of interest. I need to add an intent to send the data of my location and the point's location to a navigation app. How do I achieve this?
Asked
Active
Viewed 1,911 times
1
-
@JermaineXu am completely lost. I have been going through andorid documentation and so far i have not come across anything usefull – Princewill Obinna Iwuorie Feb 19 '13 at 07:41
-
After reading the question n:th time. It came to mind, do you even have access to the navigation app source code or any idea of the intents it uses? – Gjordis Feb 19 '13 at 07:47
-
1thanks to @AdilSoomro I found the answer [here] (http://stackoverflow.com/questions/2662531/launching-google-maps-directions-via-an-intent-on-android/2663565#2663565) – Princewill Obinna Iwuorie Feb 19 '13 at 07:55
-
Please ignore the bounty its meant for another question – Princewill Obinna Iwuorie Mar 04 '13 at 07:49
-
I don't know why this was marked down, it's a reasonable question even if poorly framed. If he knew exactly how to word the question he wouldn't need to ask it. – Peter Wone Mar 11 '13 at 06:39
1 Answers
0
Try this code:
Button map_button = (Button) findViewById(R.id.map_btn);
map_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = null, chooser;
intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("geo:xx.xxxxxx,xx.xxxxxx"));
chooser = Intent.createChooser(intent,"Lunch Map");
try {
startActivity(chooser);
}catch (ActivityNotFoundException e) {
e.getCause();
}
}
});
where xx.xxxxxx is your location.

Tushar Lathiya
- 940
- 9
- 26