android - Old activity context show in background of DialogActivity instead of HomeScreen -
i have set broadcast receiver starts new dialogactivity
. problem faced whenever broadcastreceiver
receives broadcast, dialogactivity
shown in background instead of homescreen, activity have registered receiver shown , on dialogactivity
shown.
following code :
@override public void onreceive(context arg0, intent i) { intent i1 = new intent(arg0,alarmdialog.class); i1.addflags(intent.flag_activity_new_task); arg0.startactivity(i1); //this leads background old activity have registered broadcast }
also if context starting dialogactivity
i.e arg0
here finished app force closes dialogactivity
requires context.
ideally, broadcast receivers should not show dialogues. should show notification, when click on can take display activity dialog. however, if you'd show dialog without activity there's description here.
Comments
Post a Comment