【发布时间】:2012-12-22 09:33:03
【问题描述】:
在我的应用程序中,当我点击一个地方时,我想触发 Intent Chooser 让用户使用 GPS 坐标进行游戏...
我希望让用户可以在 Google 地图、导航、街景或任何已安装的 GPS 之间进行选择......
到目前为止,这些应用程序中的每一个都可以以不同的意图启动......例如:
导航:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" +mLat+","+mLong));
谷歌地球:
Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("geo:"
+ "?q="
+ e.latitude
+ ","
+ e.longitude)));
谷歌地图:
Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("geo:"
+ e.latitude
+ ","
+ e.longitude
+ "?q="
+ e.latitude
+ ","
+ e.longitude)));
街景:
不同的东西
导航:
<action android:name="android.intent.action.navigon.START_PUBLIC" />
Location coordinates.
String INTENT_EXTRA_KEY_LATITUDE = "latitude";
String INTENT_EXTRA_KEY_LONGITUDE = "longitude";
任何 GPS 应用:
有没有办法为所有这些应用使用单一意图并让用户选择?
【问题讨论】:
标签: android android-intent location