Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.app.KeyguardManager;
import android.content.Context;

public class Main {
    /**
     * 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();
    }
}