I have a broadcast reciever set up in my android manifest file. However I need to show a dialog when some condition happens. I realise that the application context will not work for dialogs and I need to show it on an activity context. But even if I do that , then the background screen becomes black and blocks the current activity. I dont want that to happen . I want the popup tp overlay over the existing screen. What I have tried:
In the activity I call from my BroadcastReciever:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
Manifest of the activity:
android:windowBackground="@android:color/transparent"
android:windowIsTranslucent="true"
android:windowAnimationStyle="@android:style/Animation.Translucent"
What am I doing wrong?
and apply
android:theme="@android:style/Theme.Dialog"