Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BroadCast receiver dialog issue in Android

Tags:

android

popup

I am having the issue regarding popup in broadcast receiver. I have implemented the popup by using activity with theme dialog. But When the app is in background and i received a broadcast. the popup window display above of the my opened activity no stand alone.

How to open the popup window only, not above my background activity.

like image 882
Sandy Avatar asked Dec 17 '25 20:12

Sandy


2 Answers

I guess.. in your onReceive method... you can write this

 Intent i = new Intent(context, NightClock.class);
        i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(i); 
like image 139
success_anil Avatar answered Dec 19 '25 12:12

success_anil


Please check below link may be helpful to you

How can I display a dialog from an Android broadcast receiver?

AlertDialog in BroadcastReceiver

like image 28
Nikhil Avatar answered Dec 19 '25 13:12

Nikhil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!