开发者

How do I close out of Google Navigation programmatically?

开发者 https://www.devze.com 2023-03-29 17:54 出处:网络
I am starting Google Navigation through an Intent: private static final intGOOGLE_NAV = 5; Intent intent = new Intent(android.content.Intent.ACTION_VIEW,

I am starting Google Navigation through an Intent:

private static final int  GOOGLE_NAV = 5;

Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
            Uri.parse("google.navigation:q= some + address"));
startActivityForResult(intent,GOOGLE_NAV);

I then check if the user has reached his destination via a LocationListener. If the user has arrived, I want to close the Google Navigation activity.

if(hasArrived())
{
    finishActivity(GOOGLE_NAV);
}

However, my code doesn开发者_JAVA百科't seem to work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号