简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM