I am trying to open google maps app from my own app activity.I want to show a marker on the specific location on the maps app.What I've found till now is this piece of code.
String label = "shop";
String uriBegin = "geo:" + lat + "," + lng;
String query = lat + "," + lng + "(" + label + ")";
String encodedQuery = Uri.encode(query);
String uriString = uriBegin + "?q=" + encodedQuery + "&z=16";
Uri uri = Uri.parse(uriString);
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,uri);
startActivity(intent);
What it does is opens the map app but keeps showing me a loading messagebox
saying searching for:<lat>,<lng>(shop)
where <lat> and <lng>
are my provided values . Whats wrong with this ?
I've copied this code from another stackoverflow post.