开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜