如何在android中隐藏意图?
我有一个使用谷歌地图的应用程序。在我的例子中,我打开谷歌地图,从一个活动的外部。我做了以下几件事如何在android中隐藏意图?,android,Android,我有一个使用谷歌地图的应用程序。在我的例子中,我打开谷歌地图,从一个活动的外部。我做了以下几件事 Intent notificationIntent = new Intent(Intent.ACTION_VIEW, Uri .parse("http://maps.google.com/maps?daddr=" + latitude + "," + longitude + "&mode=driving")); notificationIntent.setFlags(
Intent notificationIntent = new Intent(Intent.ACTION_VIEW, Uri
.parse("http://maps.google.com/maps?daddr=" + latitude + "," + longitude + "&mode=driving"));
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
notificationIntent.setPackage("com.google.android.apps.maps");
notificationIntent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
context.startActivity(notificationIntent);
但当我打开地图时,它会显示在我的应用程序上。我需要避免在我的应用程序上显示地图。换句话说,我的应用程序应该是顶级应用程序。有没有办法做到这一点?你想在你的应用程序中打开谷歌地图,但你的应用程序将保持在顶部,而GMAP将保持在后台?我说得对吗?是的。这就是我想要的。:)嗯,当有人想要它时,用例是什么?你不能这样做,每当你开始一个意图时,它总是在当前活动的顶部打开。如果您想在后台做一些事情,请使用
服务@AkashSingh您希望服务如何解决这个问题?