What I am looking for is a good example (if possible) of a application wide notification alert dialog window. What I am hoping to do is register an intent filter on the application level, and anytime a broadcast is received, it will show my alert above any fragment, or activity in my application.

Right now I am having to implement it on each activity, while not a big deal seems messy, I was hoping there was a better way.

I had tried to do it once before in the application but the AlertDialog requires the activity context and not the application context.

Thanks Brian

有帮助吗?

解决方案

I've previously achieved this by declaring a broadcast receiver in a base class from which all my activities are derived.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top