Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity cannot be started from background after beacon was detected #65

Open
VictorCorchez opened this issue Aug 10, 2021 · 4 comments

Comments

@VictorCorchez
Copy link

08-10 12:57:41.554 16404 16809 D MainActivity: Current region state is: INSIDE
08-10 12:57:41.554 16404 16809 D MainActivity: Got a didEnterRegion call
08-10 12:57:41.554 16404 16809 D MainActivity: Calling startActivity()
08-10 12:57:41.556 1289 3046 D OemSceneCallBlock: isCallBlockedWithUidIntent { act=android.intent.action.MAIN flg=0x18000000 cmp=/.MainActivity }, ResolveInfo{c0dfce1 /.MainActivity m=0x0}, false
08-10 12:57:41.557 1289 3046 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN flg=0x18000000 cmp=/.MainActivity} from uid 10756 pid 16404

This happens while testing on Android 10 and seems this could be the explanation:
https://developer.android.com/guide/components/activities/background-starts

@davidgyoung
Copy link
Member

davidgyoung commented Aug 10, 2021

@VictorCorchez, yes, I believe your analysis of the problem is correct. It is no longer possible for apps to launch activities from the background.

While the original version of this reference app did try to launch an activity from the background, I removed that and replaced it with a notification last year in the commit below. Perhaps you are still using an old copy of the reference app? If there is something posted today that still has code to do this, please let us know.

0183083

@VictorCorchez
Copy link
Author

VictorCorchez commented Aug 10, 2021

so is there is no other way of launching an activity from background without user interaction? I was thinking maybe this library could use the CompanionDevice approach. But I'm not sure if it works the same to be able to launch my app if it detects the beacon.

@davidgyoung
Copy link
Member

As of Android 10 I do not believe this is possible anymore per the link you provided in this issue. I see nothing in Companion Device Pairing that would help here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants