Skip to content Skip to sidebar Skip to footer

Displaying A Alertdialog On Screen Irrespective Of Activity Screen

I want to show an Dialog Whatever the screen the User is in. Suppose if user opens application and in initial screen if I receive a server message I have to show it in a dialog.Mea

Solution 1:

You may want to consider using an Event driven model such as GreenRobot.

http://greenrobot.org/eventbus/

This would allow you to efficiently handle the scenario you describe.

Alternatively, you can use the LocalBroadcastManager to communicate between different parts of your app.

e.g Send a broadcast message when you want to display a dialog and handle that message in all of your Activities

Post a Comment for "Displaying A Alertdialog On Screen Irrespective Of Activity Screen"