简体   繁体   中英

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 choose 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM