简体   繁体   中英

Return to Main Activity after TAG_DISCOVER

I finally got my app reacting to TAG. Its build from 2 different activities. activity A is the Main activity, that get launched when i start the app. And then there is activity B which is being launched by a TAG_DISCOVER. However i have 2 problems now.

(1) Activity B has a backButton, which just does finish(); If the app were manually started i would just return to activity A, as its being startet first. However if activity B is directly launched through a discovered TAG, A isnt launched, so when pushing the BackButton the App exits, which i dont want.

(2) Each time I discover a TAG Activity B gets launched, eventhough it might already exist. But I want Activity B to only be active once a time.

This is a similar question to this

You should be able to use the same approach - detect that the activity was launched from a Tag and go 'back' to the main activity.

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