Can i detect if a user canceled navigation from Google Maps App

纵饮孤独 提交于 2019-12-11 01:49:14

问题


My app calls an Intent to open the Google Maps App like so

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. 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?


回答1:


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.

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.

this would be very hacky and I dont even know if it would work but its an idea i guess



来源:https://stackoverflow.com/questions/19143598/can-i-detect-if-a-user-canceled-navigation-from-google-maps-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!