How do I show a marker in Maps launched by geo URI Intent?

后端 未结 7 1652
离开以前
离开以前 2020-11-28 02:47

I have a application where I want to show different locations (one at the time, picked by user input) by launching Google Maps with their specific geo coordinates.

I

7条回答
  •  温柔的废话
    2020-11-28 03:27

    Try this:

    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:,?q=,(Label+Name)"));
    startActivity(intent);
    

    You can omit (Label+Name) if you don't want a label, and it will choose one randomly based on the nearest street or other thing it thinks relevant.

提交回复
热议问题