src/main/java/de/blau/android/util/Util.java
/**
     * Share the supplied position with other apps
     * 
     * @param activity this activity
     * @param lonLat coordinates to share
     * @param z the zoom level or null
     */
Share the supplied position with other apps

@param activity this activity
@param lonLat coordinates to share
@param z the zoom level or null
Share the supplied position with other apps @param activity this activity @param lonLat coordinates to share @param z the zoom level or null
public static void sharePosition(@NonNull Activity activity, @Nullable double[] lonLat, @Nullable Integer z) {
        if (lonLat != null) {
            Uri geo = Uri.parse("geo:" + String.format(Locale.US, "%.7f", lonLat[1]) + "," + String.format(Locale.US, "%.7f", lonLat[0])
                    + (z != null ? "?z=" + z.toString() : ""));
            Log.d(DEBUG_TAG, "sharing " + geo);
            Intent geoIntent = new Intent(Intent.ACTION_VIEW, geo);
            activity.startActivity(geoIntent);
        }
    }
public static void sharePosition ( @ NonNull Activity activity , @ Nullable double [ ] lonLat , @ Nullable Integer z ) { if ( lonLat != null ) { Uri geo = Uri . parse ( "geo:" + String . format ( Locale . US , "%.7f" , lonLat [ 1 ] ) + "," + String . format ( Locale . US , "%.7f" , lonLat [ 0 ] ) + ( z != null ? "?z=" + z . toString ( ) : "" ) ) ; Log . d ( DEBUG_TAG , "sharing " + geo ) ; Intent geoIntent = new Intent ( Intent . ACTION_VIEW , geo ) ; activity . startActivity ( geoIntent ) ; } }
Share the supplied position with other apps
Share the supplied position with other apps