1

SO Link here specifies how we get an activity with a transparent background. I'm not clear on what state the activity under it is in. Is it paused because a transparent activity is maybe like a modal dialog? Or is it stopped? Will it ever disappear if the activity get killed? Will I always see this background?

As an additional question, Can I pass touch events to this activity below? So that I can allow my user to interact with the activity below.

Community
  • 1
  • 1
Aks
  • 5,188
  • 12
  • 60
  • 101

1 Answers1

2

The foreground activity is still in the same state as any normal activity. The only difference is that the activity's window background is transparent. The background activity will be paused since it is still visible to the user in the background.

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
  • not the one on top. I'm referring to the one that is visible because of the transparency. – Aks Nov 20 '14 at 17:48
  • 1
    Changing the current activity's window background color won't affect the state of any other activities. They will be in the same state as if the current activity had an opaque background. – Alex Lockwood Nov 20 '14 at 17:50
  • So there's basically no guarantee that I'd continue to see the same background? – Aks Nov 20 '14 at 17:52
  • I'm going to confirm, but I don't believe this answer is accurate. If the windowIsTransparent flag is set, then the activity below should be PAUSED, not STOPPED. – Kevin Coppock Nov 20 '14 at 17:53
  • There is no guarantee. That said, the framework prioritizes partially-visible activities over other non-visible background activities, so the chance that you'd see the background activity disappear is probably much less likely. – Alex Lockwood Nov 20 '14 at 17:56
  • As an addition to the question, Can I pass all touch events in the transparent area to the activity directly below? – Aks Nov 20 '14 at 17:58
  • @kcoppock Yeah, my original answer referred to the foreground transparent activity. I updated my answer with information about the background non-transparent activity as well. – Alex Lockwood Nov 20 '14 at 18:01