android.os.PowerManager.WakeLock
Class lets you say that you need to have the device on.
Call release when you are done and don't need the lock anymore.
Summary
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Methods
public
void
acquire()
Makes sure the device is on at the level you asked when you created
the wake lock.
public
void
acquire(long timeout)
Makes sure the device is on at the level you asked when you created
the wake lock. The lock will be released after the given timeout.
Parameters
timeout
| Release the lock after the give timeout in milliseconds.
|
public
void
release()
Release your claim to the CPU or screen being on.
It may turn off shortly after you release it, or it may not if there
are other wake locks held.
public
void
setReferenceCounted(boolean value)
Sets whether this WakeLock is ref counted.
Parameters
value
| true for ref counted, false for not ref counted.
|
public
String
toString()
Returns a string containing a concise, human-readable description of the
receiver.
Returns
- String a printable representation for the receiver.
Protected Methods
protected
void
finalize()
Called by the virtual machine when there are no longer any (non-weak)
references to the receiver. Subclasses can use this facility to guarantee
that any associated resources are cleaned up before the receiver is
garbage collected. Uncaught exceptions which are thrown during the
running of the method cause it to terminate immediately, but are
otherwise ignored.
Note: The virtual machine assumes that the implementation in class Object
is empty.