mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Open map at given location
This commit is contained in:
parent
064fc63265
commit
d1da89ca5b
1 changed files with 2 additions and 3 deletions
|
|
@ -143,11 +143,10 @@ public class NearbyListFragment extends ListFragment {
|
||||||
|
|
||||||
Log.d(TAG, "Item at position " + position + " has coords: Lat: " + latitude + " Long: " + longitude);
|
Log.d(TAG, "Item at position " + position + " has coords: Lat: " + latitude + " Long: " + longitude);
|
||||||
|
|
||||||
Uri gmmIntentUri = Uri.parse("geo:" + latitude + "," + longitude + '"');
|
//Open map app at given position
|
||||||
|
Uri gmmIntentUri = Uri.parse("geo:0,0?q=" + latitude + "," + longitude + '"');
|
||||||
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
|
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
|
||||||
|
|
||||||
mapIntent.setPackage("com.google.android.apps.maps");
|
|
||||||
|
|
||||||
if (mapIntent.resolveActivity(getActivity().getPackageManager()) != null) {
|
if (mapIntent.resolveActivity(getActivity().getPackageManager()) != null) {
|
||||||
startActivity(mapIntent);
|
startActivity(mapIntent);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue