我想啓動一些接受地理座標的應用程序(http://developer.android.com/training/sharing/send.html)。問題是他們想要不同的URI。Make Intent.ACTION_VIEW接受多個URI
例(僞碼):
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.addSomeUri("http://maps.google.com/maps/?daddr="+myAddress);
intent.addSomeUri("http://someotherservice.com/?coordinates="+myLat+":"+myLng+"&address=myAddress");
編輯: 課程的目標是爲這兩個應用出現在相同的活性選擇器。
我該如何實現它?
但是,它不會打開兩個選擇一個接一個?我希望這兩個應用都顯示在同一個活動選擇器中。 –
@MichałK:「但是它不會一個接一個地打開兩個選擇器嗎?」 - 是的。 「我希望這兩個應用程序都出現在同一個活動選擇器中」 - 這隻有通過'PackageManager'和'queryIntentActivities()'創建自己的「活動選擇器」纔有可能。 – CommonsWare
這就是我的答案(儘管我真的希望這很簡單,就像我在我的問題中所述)。謝謝! –