简体   繁体   中英

Back to my application when call direction from google map in Android

I have an application get direction via google map. Example Activity A call google map:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(myuri));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setClassName("com.google.android.apps.maps","com.google.android.maps.MapsActivity");
startActivity(intent);

It show Image 1: http://flic.kr/p/eBnRCy then show Image 2: http://flic.kr/p/eBjGWn

How to from image 2, I can back again my application(Activity A), don't back again image 1. Thanks a lot.

You may try to hack it with Intent.FLAG_ACTIVITY_NO_HISTORY , which removes first Activity as soon as a second is opened. This will work if the two screens you put into question are two instances of Activity (even if they are the same class).

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