Code example for PowerManager.WakeLock

Methods: isHeld, release

0
        mWakeLock.acquire();
        Log.d(mTag, "Wake lock acquired");
    } 
 
    public void releaseWakeLock() { 
        if(mWakeLock != null && mWakeLock.isHeld()) {
            mWakeLock.release();
            Log.d(mTag, "Wake lock released");
        } 
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java