Possible Duplicate:
Lock the android device programatically
How can I programmatically lock the screen in Android?
Possible Duplicate:
Lock the android device programatically
How can I programmatically lock the screen in Android?
In order to do this you need to use the Device Administration API that was added in (I think) 2.2. Once your app is registered on the device as a device administrator, you can then use DevicePolicyManager.lockNow() to lock the screen. The DeviceAdmin sample application in the SDK is a good place to look as well.