前言

ActivityThread.java是有Activity的生命周期方法。

以前写的,重新摘录于此

正文

androidp\frameworks\base\core\java\android\app\ActivityThread.java

performResumeActivity

/**
 * Resume the activity.
 * @param token Target activity token.
 * @param finalStateRequest Flag indicating if this is part of final state resolution for a
 *                          transaction.
 * @param reason Reason for performing the action.
 *
 * @return The {@link ActivityClientRecord} that was resumed, {@code null} otherwise.
 */
@VisibleForTesting
public ActivityClientRecord performResumeActivity(IBinder token, boolean finalStateRequest,
        String reason) {
         
         //这里表示Activity进入前台了,可以写属性或广播给需要的
         
}

performPauseActivity

/**
 * Pause the activity.
 * @return Saved instance state for pre-Honeycomb apps if it was saved, {@code null} otherwise.
 */
private Bundle performPauseActivity(ActivityClientRecord r, boolean finished, String reason,
        PendingTransactionActions pendingActions) {
        //这里表示Activity进入后台了
}

当然也有其他的执行方法,这里不细说。

参考文章

相关文章

暂无评论

none
暂无评论...