0

I am building a VoIP app and it has an incoming call screen. Instead showing the screen, I want to just show a heads up notification, if current foreground app is in full screen mode. Is this possible? Is there a way to check if the current running activity is in full screen?

Codevalley
  • 4,593
  • 7
  • 42
  • 56
  • Perhaps this is what you're looking for: http://stackoverflow.com/questions/32365177/full-screen-notification-only-showing-as-a-heads-up – dstrube Aug 25 '16 at 13:41

1 Answers1

0
WindowManager.LayoutParams lp = getWindow().getAttributes();
        if(lp.flags == WindowManager.LayoutParams.FLAG_FULLSCREEN){
            //Do your stuff
        }

Edit
If the running app is not your app you need to take a different approach which possible only from API 11, and use View.OnSystemUiVisibilityChangeListener:

Callback to be invoked when the status bar changes visibility. This reports global changes to the system UI state, not what the application is requesting

Nir Duan
  • 6,164
  • 4
  • 24
  • 38