我正在开发从当前位置到目的地的逐步导航。 我使用以下代码完成了这项工作:
Uri gmmIntentUri = Uri.parse("google.navigation:q="+address);
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
问题在于,如果在屏幕1中点击返回按钮,会跳转到屏幕2。然后,如果我在屏幕2中点击返回按钮,会跳转到屏幕3、屏幕4,最终回到我的活动界面。
我想要的是,如果我在屏幕1中点击返回按钮,如何直接回到我的活动界面?如何通过在屏幕1中点击返回按钮来结束屏幕2、屏幕3、屏幕4?
屏幕1:
![enter image description here](https://istack.dev59.com/uy1dU.webp)
![enter image description here](https://istack.dev59.com/znluf.webp)
![enter image description here](https://istack.dev59.com/NCn6h.webp)
![enter image description here](https://istack.dev59.com/VMqgH.webp)