Android Full Screen Not Working When Activity Is Launched By A Service
So I am developing an alternate lockscreenapp and I need to prevent clicking the notificationbar so I try to run this app in fullscreenn but when it is calle by a service the notif
Solution 1:
I used full screen before same as your way and had some problems but didn't try launching the activity from service, try to apply full screen this way,
WindowManager.LayoutParamsattrs= getWindow().getAttributes();
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
getWindow().setAttributes(attrs);
just in case you need to exit full screen, you can do it this way,
WindowManager.LayoutParamsattrs= getWindow().getAttributes();
attrs.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().setAttributes(attrs);
give it a shot, good luck!
Solution 2:
It seems that this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
causes the issue.
Someone else suggests to delay that call: See Activity doesn't show in full screen.
Post a Comment for "Android Full Screen Not Working When Activity Is Launched By A Service"