Release the devices screen lock. - Android User Interface

Android examples for User Interface:Screen Lock

Description

Release the devices screen lock.

Demo Code


//package com.java2s;
import android.app.KeyguardManager;
import android.content.Context;

public class Main {
    /**/*from w  w w .ja  v a  2  s.  co  m*/
     * Release the devices screen lock.
     * @param context
     */
    public static void releaseScreenLock(Context context) {
        KeyguardManager keyguardManager = (KeyguardManager) context
                .getApplicationContext().getSystemService(
                        Context.KEYGUARD_SERVICE);
        KeyguardManager.KeyguardLock keyguardLock = keyguardManager
                .newKeyguardLock("TAG");
        keyguardLock.disableKeyguard();
    }
}

Related Tutorials