the reference answer GPT ᴼ ᴾ ᴱ ᴺ ᴬ ᴵ < br / > in Android, When you startActivity B by calling the startActivityForResult() method in Activity A, if you want to return data to Activity A after the execution of Activity B, You need to use the setResult() method in Activity B to set the return result and call it in Activity B's finish() method.
In your case, you should call the setResult() method and set the result to return when you click the screenshot function on the B screen, and close the B screen by calling the finish() method. This way, after the B screen closes, Activity A's onActivityResult() method is called, and you can work with the data returned by the B screen in this method.
If you start another Activity C by calling startActivityForResult() in the B screen, you need to set the return result using the setResult() method in the C screen and call it in the finish() method in the C screen to return data to the B screen. When the B screen closes, Activity A's onActivityResult() method is called, where you can work with the data returned by the B screen.
Also, it's important to note that in Android, when one Activity is in the foreground, the life cycle of the other activities is affected. Therefore, in your case, when screen B pops up and takes A screenshot, screen B may lose focus, causing Activity A's onActivityResult() method to not be called. To avoid this, it is recommended that you use asynchronous threads to handle the hover window in screen B's screenshot function to avoid blocking the main thread.