开发者

How to open a list of maps installed in device?

开发者 https://www.devze.com 2023-03-12 09:03 出处:网络
I want to open a list of installed maps and navigation applications on the device, with abutton click. How do I get the list of installed map applications such as: yahoo map, google map, bing maps, et

I want to open a list of installed maps and navigation applications on the device, with a button click. How do I get the list of installed map applications such as: yahoo map, google map, bing maps, etc. For example, i have AT&T map, Google map, Google navigation and yahoo map on my mobile. Now when user clicks on the button, i just want to op开发者_StackOverflow社区en a list which contains all.


You need to pass an empty geo-URI to the intent chooser:

Intent intent = new Intent(Intent.ACTION_VIEW, "geo:0,0?q=");
startActivity(Intent.createChooser(intent, "Select application"));

If you want to get information about activities that support geo-URIs, you can use the following code:

Intent intent = new Intent(Intent.ACTION_VIEW, "geo:0,0?q=");
List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent,
    PackageManager.MATCH_DEFAULT_ONLY);
0

精彩评论

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