@Retention(value=CLASS) @Target(value=METHOD) public @interface WakeLock
Acquires a PowerManager.WakeLock for this method call.
May be used on methods with @Background or @UiThread.
NOTE: To use WakeLocks you need the android.permission.WAKE_LOCK permission.
Example:
@EActivity
public class MyActivity extends Acitivy {
@WakeLock
void backgroundTask() {
// this code executes with an active WakeLock.
}
}
PowerManager,
PowerManager.WakeLock| Modifier and Type | Fields and Description |
|---|---|
static String |
DEFAULT_TAG
Indicates the client did not give a tag.
|
| Modifier and Type | Optional Element and Description |
|---|---|
WakeLock.Flag[] |
flags
The optional flags for the created
WakeLock. |
WakeLock.Level |
level
The level of the created
WakeLock. |
String |
tag
The tag of the created WakeLock.
|
public static final String DEFAULT_TAG
public abstract String tag
PowerManager.newWakeLock(int, String)public abstract WakeLock.Level level
WakeLock.PowerManager.newWakeLock(int, String)public abstract WakeLock.Flag[] flags
WakeLock.PowerManager.newWakeLock(int, String)Copyright © 2010-2015. All Rights Reserved.