0

I try to start a transparent full screen activity from a service when the user press the notification. The problem is not to launch the activity it self, this works perfect. My problem is that the currently active app freezes, for example youtube stops playing the video. I want youtube to continue playint the video. My code builds on the solution described here: How do I create a transparent Activity on Android? . I have also read something about launching alert dialog from the service using SYSTEM_ALERT_WINDOW flag and Windowmanager: How to display a fullscreen TYPE_SYSTEM_ALERT window? . But how can i do this when the user press the notification?

I have seen apps like that i describe so i know it's possible to solve ;)

Best regards,

Henrik

Community
  • 1
  • 1
noned
  • 1

1 Answers1

0

My problem is that the currently active app freezes, for example youtube stops playing the video

Just because your new activity is transparent doesn't mean your previous activity will keep running beneath you. When an activity is replaced by another on the stack, onPause() is called in that activity.

If you want a transparent overlay, just use a View. You don't need an Activity to have a View.

I have also read something about launching alert dialog from the service using SYSTEM_ALERT_WINDOW flag and Windowmanager: How to display a fullscreen TYPE_SYSTEM_ALERT window? . But how can i do this when the user press the notification?

You can draw views in a System Alert Window from a Service.

Thomas Dignan
  • 7,052
  • 3
  • 40
  • 48