flutter_overlay_window icon indicating copy to clipboard operation
flutter_overlay_window copied to clipboard

Bring app to foreground from overlay.

Open adityaraj1702 opened this issue 10 months ago • 1 comments

Suppose overlay is active and I presses home button. Then app goes to background and overlay is still showing which is good. Now if I want to bring back my app to foreground then there is no implementation or functions to do this.

adityaraj1702 avatar Feb 14 '25 11:02 adityaraj1702

@adityaraj1702 use ports to communicate between MainApp and Overlay and MethodChannel to call native code.

overlay.onTap -> IsolateNameServer.lookupPortByName(your_main_port_name)?.send("home") MainAppPortListener(message) -> message == "home" ? methodChannel.invokeMethod("startMainActivity") MainActivity -> call.method == "startMainActivity" ? startActivity(getPackageManager().getLaunchIntentForPackage(getPackageName()))

remarkked avatar Feb 28 '25 03:02 remarkked