0

For example, I want to write an activity that launches when you return from sleep (black screen). How can I set this activity to run instead of the default one? In other words, I want to make a custom lock screen.

Thanks

2Real
  • 4,321
  • 4
  • 23
  • 27

1 Answers1

1

There is no API for doing this in the Android SDK today -- sorry!

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • so you're saying there's no way to write a custom lock screen? Then, how do Motorola and HTC do it? There's also some apps out there that change your lock screen. – 2Real Mar 31 '10 at 22:23
  • Motorola and HTC have customized the UI of Android entirely. This doesn't mean the functionality to do so is available in the SDK. – synic Mar 31 '10 at 22:27
  • ah, and there's no way to change tiny pieces of it? So, I can't detect waking up from sleep on the phone and launch my activity over the default locking activity? I thought you could do stuff like that for say phone calls. – 2Real Mar 31 '10 at 22:30
  • No. In fact, if I understand properly, if you try, your process gets terminated. You are welcome to implement a custom lock screen in a custom firmware build for your own phone, though -- that is effectively what Motorola, HTC, and others have done. – CommonsWare Mar 31 '10 at 22:53
  • well, I found this app someone wrote and I thought it was possible http://code.google.com/p/mylockforandroid/ – 2Real Mar 31 '10 at 23:02
  • That is not a "custom lock screen" as conventionally defined. As I indicated, there is no API for doing that. What this application does is exploit some security holes, much like malware might, to achieve the effect of a lock screen. For example, even if the user wants the built-in lock screen, that application disables it. My sincere hope is that these security holes are plugged in future versions of Android. – CommonsWare Mar 31 '10 at 23:47