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);
精彩评论