views:

601

answers:

1

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

+1  A: 

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

CommonsWare
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
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
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
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
well, I found this app someone wrote and I thought it was possible http://code.google.com/p/mylockforandroid/
2Real
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
ah i see thanks
2Real