Here you can find the source of locate(Context context, String chooserTilte, String lat, String lng, String addr)
public static void locate(Context context, String chooserTilte, String lat, String lng, String addr)
//License from project: Open Source License import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Looper; import android.telephony.TelephonyManager; import android.util.DisplayMetrics; import android.view.View; import android.view.WindowManager; import android.webkit.URLUtil; public class Main{ public static void locate(Context context, String chooserTilte, String lat, String lng, String addr) { if (null == context) { return; }/*from ww w . j av a 2 s . c o m*/ Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // intent.setData(Uri.parse("geo:" + lat + "," + lng + "?q=my+street+address")); String uri = "geo:0,0" + "?q=" + lat + "," + lng; if (null != addr && addr.length() > 0) { uri += ("(" + addr + ")"); } intent.setData(Uri.parse(uri)); try { context.startActivity(Intent .createChooser(intent, chooserTilte).addFlags( Intent.FLAG_ACTIVITY_NEW_TASK)); // context.startActivity(intent); } catch (Exception e) { ToastUtil.showToast(context, "exception"); } } }