============ Problem Description ============
Warrior, if I want to start activity B in activity A, then activity A can also send status information to B, B and then according to the status of a sent to determine its own changes, such as a send Exit command, B received after the finish, such an idea can be achieved?
All of this is because, for example, when logging in, considering the relationship between the network delay, when the user point button, I want to appear a loading interface, covering the login interface, and then when the server returned to success, loading that interface becomes a checkmark √ picture, Failure becomes a picture of a fork X and disappears after a short pause, so what should be done?
============ Solution 1============
can use Dialog, customize a ProgressDialog, click the button, let this dialog.show, there will be a pop-up layer covering the current page, etc., after completion, Dialog.dismiss () can let Dialog disappear, specifically Baidu search Custom loading Dialog, a lot of tutorials, I hope to help you
============ Solution 2============
Try activity A with startactivityforresult (), determine which image is displayed according to the data on the server after activity B receives the data, and activity B returns the data obtained from the server to the activity A and finish (), and you can do other things before the finish of activity B, of course, this is theoretical, actually, you try it first.
============ Solution 3============
Network access is done in a sub-thread, so your needs should be communication between the network sub-thread and the loading activity, rather than the loading activity's communication with its parent activity.
As for the network sub-thread and loading activity communication, the use of ready-made Looper/handler mode is possible.
The problem of communication between Android activity