You can use LatLng to provide latitude and longitude via Intent. - Android Intent

Android examples for Intent:Map

Description

You can use LatLng to provide latitude and longitude via Intent.

Demo Code


//package com.java2s;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;

public class Main {
    /**/*ww  w.ja  v a  2  s  .c om*/
     * You can use LatLng to provide latitude and longitude.
     * <br>
     * Starts a External Map intent.
     */
    public static void startExternalMapByGeo(Activity activity,
            String latitude, String longitude, String searchCriteria) {

        Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
                Uri.parse("geo:" + latitude + "," + longitude + "?q="
                        + searchCriteria.replace(" ", "+")));
        activity.startActivity(intent);
    }
}

Related Tutorials