开发者

How to open a list of maps installed in device?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜