7

I have an activity. The launch mode is singleTask, and I implement onNewIntent. When I send an intent to launch this activity while the activity is open (with flags NEW_TASK and RESET_TASK_IF_NEEDED), the screen flashes before showing me the same activity.

Why could this be happening? I thought singleTask should be enough to ensure that new intents are delivered to onNewIntent, rather than the system spinning up a new task or anything for my activity. The flashing goes away when I do either of the following things:

  • change the launch mode to singleTop;
  • add the flag Intent.FLAG_ACTIVITY_CLEAR_TOP to the launch intent.

I'm curious to know what's going on and what, if anything, I could do to overcome the flashing (I'd really prefer not to change the launch mode or launch intent flags, if at all possible). Basically, is there any good reason why this should not work?

Note that I do get onNewIntent, even though the screen flashes.

Patrick87
  • 27,682
  • 3
  • 38
  • 73
  • Have a look at this post [blinking-screen-on-image-transition-between-activities](https://stackoverflow.com/questions/28364106/blinking-screen-on-image-transition-between-activities) – Eli Oct 14 '17 at 07:59

0 Answers0