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

Overlay Window doesn't disappear when app is in kill state #123

Open
nahit-fidanci-alg opened this issue Aug 13, 2024 · 2 comments
Open

Comments

@nahit-fidanci-alg
Copy link

Hi everyone,

I show overlay window when the app is in the background. And hide it when the app is foreground. At this point, it works well. But when the app is in the background, after the overlay window is shown, if I kill the app, the overlay window stays. And also my app is still working on the overlayMain(). Overlay window doesn't go anywhere until I purposely stop the app on IDE.

What I did

I try to use AppLifecycleState to close overlay on detached state. Even if I can catch the state and run closeOverlay function, nothing happens at all.
I tried to use Isolates. Send an event called killOverlay to do the killing staff in overlay window widget. But it didn't work either.

I couldn't find a similar issue on the repo. Do you know if this is a known case? Any workaround to kill the overlay will be great.

@nahit-fidanci-alg nahit-fidanci-alg changed the title Overlay Window doesn't disappear on app is killed. Overlay Window doesn't disappear when app is in kill state Aug 13, 2024
@nahit-fidanci-alg
Copy link
Author

It seems that overlay runs on a different isolate on DartVM. Only way to stop it to exit(0) the app. Is there any other solution to stop overlay window without killing the DartVM?

@sikandersaleem
Copy link

All below lines in MainActivity.kt.

override fun onDestroy() { super.onDestroy() if (OverlayService.isRunning) { stopService(Intent(this, OverlayService::class.java)) } Log.d("Lifecycle", "onDestroy") }

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