前言

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

以前写的,重新摘录于此

正文

  1. androidp\frameworks\base\core\java\android\app\ActivityThread.java
复制

performResumeActivity

  1. /**
  2. * Resume the activity.
  3. * @param token Target activity token.
  4. * @param finalStateRequest Flag indicating if this is part of final state resolution for a
  5. *                         transaction.
  6. * @param reason Reason for performing the action.
  7. *
  8. * @return The {@link ActivityClientRecord} that was resumed, {@code null} otherwise.
  9. */
  10. @VisibleForTesting
  11. public ActivityClientRecord performResumeActivity(IBinder token, boolean finalStateRequest,
  12.       String reason) {
  13.        
  14.         //这里表示Activity进入前台了,可以写属性或广播给需要的
  15.        
  16. }
复制

performPauseActivity

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

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

参考文章

相关文章

暂无评论

none
暂无评论...