| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.app.servertransaction; |
| 18 |
|
| 19 |
import android.annotation.IntDef; |
| 20 |
|
| 21 |
import java.lang.annotation.Retention; |
| 22 |
import java.lang.annotation.RetentionPolicy; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
public abstract class ActivityLifecycleItem extends ActivityTransactionItem { |
| 29 |
|
| 30 |
@IntDef(prefix = { "UNDEFINED", "PRE_", "ON_" }, value = { |
| 31 |
UNDEFINED, |
| 32 |
PRE_ON_CREATE, |
| 33 |
ON_CREATE, |
| 34 |
ON_START, |
| 35 |
ON_RESUME, |
| 36 |
ON_PAUSE, |
| 37 |
ON_STOP, |
| 38 |
ON_DESTROY, |
| 39 |
ON_RESTART |
| 40 |
}) |
| 41 |
@Retention(RetentionPolicy.SOURCE) |
| 42 |
public @interface LifecycleState{} |
| 43 |
public static final int UNDEFINED = -1; |
| 44 |
public static final int PRE_ON_CREATE = 0; |
| 45 |
public static final int ON_CREATE = 1; |
| 46 |
public static final int ON_START = 2; |
| 47 |
public static final int ON_RESUME = 3; |
| 48 |
public static final int ON_PAUSE = 4; |
| 49 |
public static final int ON_STOP = 5; |
| 50 |
public static final int ON_DESTROY = 6; |
| 51 |
public static final int ON_RESTART = 7; |
| 52 |
|
| 53 |
|
| 54 |
@LifecycleState |
| 55 |
public abstract int getTargetState(); |
| 56 |
|
| 57 |
|
| 58 |
@Override |
| 59 |
public void recycle() { |
| 60 |
} |
| 61 |
} |