您好我正在使用內置Google Map來顯示路由到用戶。 當我點擊get route按鈕時,我寫下了下面的代碼。從意圖調用另一個應用程序終止正在運行的應用程序
String mapURL="http://maps.google.com/mapssaddr="
+GlobleVeriable.getCurrentLocation().getLatitude()+","+GlobleVeriable.getCurrentLocation().getLongitude()+"&daddr="+restaurant.getLatitude()
+","+restaurant.getLongitude();
Intent i=new Intent("android.intent.action.VIEW",Uri.parse(mapURL));
startActivity(i);
此代碼工作正常,也顯示路線從當前位置到目的地的位置.. 我回來的時候,從谷歌地圖我的申請,我的應用從第一次啓動。
任何人都可以建議我該怎麼做?
您是否嘗試過startActivity(I)的startActivityForResult(I)istead的代碼? – user370305
當你從Google地圖返回時,你想要發生什麼? –