My app, shows a dialog box to the user before the lock screen. It's a simple Activity that contains DialogFragments (from the support library as this app runs on 2.2+).
Since the actual activity that displayed those dialogs was not a floating window by Android's standards,
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
worked fine.
However, I was thinking I'd use an Activity that looks like a Dialog instead. All the Dialog themes (Holo, etc), though, have this item:
<item name="android:windowIsFloating">true</item>
This, for some reason causes the window flag to be completely ignored. Interestingly, the Activity gets shown after the user unlocks the screen.
Why would this be so, and is there a way around it?
For Funtouch OS 3.0 and higher version, you can go to Settings>More settings>Permission management(Applications)>Floating window to turn on/off the floating window of your apps.
Open the first app. Drag up from the bottom of the home screen, hold, then release. Or, touch if you're using 3-button navigation. Be sure to touch the app's icon instead of the preview, which opens the app.
Suffering from the same issue. The only thing that seems to work in this issue is
KeyguardManager myKeyGuard = (KeyguardManager)getSystemService(Context.KEYGUARD_SERVICE);
myLock = myKeyGuard.newKeyguardLock("tagName");
myLock.disableKeyguard();
Dont forget to use the keyguard permission in manifest:
<uses-permission android:name = "android.permission.DISABLE_KEYGUARD"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With