[英]Can i detect if a user canceled navigation from Google Maps App
My app calls an Intent
to open the Google Maps App like so 我的应用程序这样调用Intent
以打开Google Maps App
Intent navigation = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q="+trueFriend.lat+","+trueFriend.lon));
startActivity(navigation);
When i do that i would like to set a ProximityListener to detect if the user has arrived to there location, then let the other user know that they have arrived. 当我这样做时,我想设置一个ProximityListener来检测用户是否已到达该位置,然后让其他用户知道他们已到达。 That much i can do, however in order to prevent a few issues i need to detect if a user has canceled there navigation, or stopped, or possibly even resumed. 我可以做很多事情,但是为了防止出现一些问题,我需要检测用户是否已取消导航,停止,甚至恢复导航。 Is there any documentation to this? 是否有任何文档?
No you are in another app so there is no way of knowing if the user has canceled the navigation from the google maps app. 不,您在另一个应用程序中,因此无法知道用户是否已从google maps应用程序取消了导航。
Edit 编辑
something you could possibly do but would only work on 4.3 would be to set a notification listener
and check to see if the navigation notification still exists, if it doesnt then they quit it. 您可能可以做但只能在4.3上使用的方法是设置一个notification listener
并检查导航通知是否仍然存在,如果不存在则退出。
this would be very hacky and I dont even know if it would work but its an idea i guess 这将是非常hacky,我什至不知道它是否会工作,但我想这是一个主意
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.