2

I am developing for the HTC Desire HD Android 2.3.3 API10. I have an app registered as homescreen which now finally starts up nicely after booting. Problem is, there is a Keyguard right after booting up, which is telling me there is no SIM card inserted, emergency only ... which I have to manually unlock.

The device will be part of an installation hanging from the ceiling or something, so it must start without human interaction.

How can I circumvent the startup keyguard?

I have this in the manifest:
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />

and this code in place before the app does anything else:

Window wind = this.getWindow(); //Is this preventing Keyguard on startup??
wind.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
wind.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
Alex K
  • 8,269
  • 9
  • 39
  • 57
antion
  • 33
  • 6
  • i solved it by inserting this obvious code `wind.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);` – antion Feb 15 '12 at 21:34

1 Answers1

1

I solved it by inserting this code:

wind.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
Conner
  • 30,144
  • 8
  • 52
  • 73
antion
  • 33
  • 6