android - Notify currently visible activity via broadcast -
I'm relatively new to Android programming and I'm currently developing Android apps with mono-Android (Xamerine). I can convert the Java solution to C # so that do not worry about posting Java solutions. Now for the scenario,
My app flow is of the following;
The user starts the app -> The app implements the background thread to check an item update -> Navigate through the app while the user is allowed the thread is returned -> If there are updates, the current view activity should show an HUD and update the item.
I have tried to apply the above by creating a broadcast receiver, when it updates, it indicates that I then get all the activities from a base class which listens to this broadcast and shows the HUD loader. is.
However, it seems that all activities in the back stack are also notified when there is an update and the same code, the segment that shows the HOD loader is executed several times. What is the most specific way to inform activity (owned by the application and visible) so that the loader is shown only once? Or is there any other way that I can achieve this, besides using the broadcast receiver? Any help on this will be appreciated.
A method of obtaining it must be registered and the United Nations- on your broadcast receiver (onstart) and For more information about the lifecycle callbacks of Android, let's say
Comments
Post a Comment