문제

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