开发者

How do I close out of Google Navigation programmatically?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜