How do you open maps to the default location? Essentially, I want to have a button that opens google maps just like it would be opened if you started it from the apps menu, with it focused on the current location you are. No directions or navigation or arbitrary coordinates. Below is what I have so far, obviously it’s trying to open with navigation from one point to another. Thanks for your help.
mapButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
String uri = "http://maps.google.com/maps?saddr=" + "9982878"
+ "," + "76285774" + "&daddr=" + "9992084" + ","
+ "76286455";
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse(null));
intent.setClassName("com.google.android.apps.maps",
"com.google.android.maps.MapsActivity");
startActivity(intent);
}
Just launch the google maps app, here is an example: