问题
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