开发者

How to add own application to the list of Maps Applications?

开发者 https://www.devze.com 2023-03-10 09:50 出处:网络
If some other application wants to show something on the map (uses link geo:lat,lng), then before showing the map, it shows \'Maps Applications\' list. So, I could ch开发者_StackOverflow社区oose which

If some other application wants to show something on the map (uses link geo:lat,lng), then before showing the map, it shows 'Maps Applications' list. So, I could ch开发者_StackOverflow社区oose which map application should be started.

How can I add my own application to this list?


The list here shows the various URL formats used to launch Google apps (including maps). To launch maps you would use:

try {
    Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW,       
        Uri.parse("geo:0.00,0.00"));
    startActivity(myIntent);
} catch (URISyntaxException e) { }

If you want the user to be presented with the option to open your app instead of Google Maps, then you have to register to handle the same Intent in your manifest, maybe something along the lines of this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号