Intent.FLAG_ACTIVITY_NEW_TASK still bundles activities in the same task

626 Views Asked by At

I have a starting\home activity that is first launched.

In another flow I wrote a broadcast receiver that is triggered by the dialer.

The later shows an transparent activity with popup-fragment on it.

    @Override
    protected void handleReceive(Context context, Intent intent) {
..
                Intent i = new Intent(context, PopupActivity.class);
                i.putExtra(Constants.DIALED_PHONE, phoneDal.getItem(phoneNumber));
                i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(i);
                setResultData(null);

and yet the popup appear with the transparent hosting activity

but also the "home\main\launch" activity that was opened before hand.

Also when I hide the popup (pressing "home" button)

I see all my app activities are gathered to on task, and not two as I expected. why is that?

wasn't i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); supposed to solve this?

0

There are 0 best solutions below