android.app.Activity.isChangingConfigurations()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(367)

本文整理了Java中android.app.Activity.isChangingConfigurations()方法的一些代码示例,展示了Activity.isChangingConfigurations()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.isChangingConfigurations()方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:isChangingConfigurations

Activity.isChangingConfigurations介绍

暂无

代码示例

代码示例来源:origin: bluelinelabs/Conductor

final void activityStopped(@NonNull Activity activity) {
  final boolean attached = this.attached;
  if (viewAttachHandler != null) {
    viewAttachHandler.onActivityStopped();
  }
  if (attached && activity.isChangingConfigurations()) {
    needsAttach = true;
  }
  onActivityStopped(activity);
}

代码示例来源:origin: square/assertj-android

@TargetApi(HONEYCOMB)
public S isNotChangingConfigurations() {
 isNotNull();
 assertThat(actual.isChangingConfigurations()) //
   .overridingErrorMessage("Expected not to be changing configurations but was changing.") //
   .isFalse();
 return myself;
}

代码示例来源:origin: square/assertj-android

@TargetApi(HONEYCOMB)
public S isChangingConfigurations() {
 isNotNull();
 assertThat(actual.isChangingConfigurations()) //
   .overridingErrorMessage("Expected changing configurations but was not changing.") //
   .isTrue();
 return myself;
}

代码示例来源:origin: k9mail/k-9

@Override
public void onDestroy() {
  super.onDestroy();
  Activity activity = getActivity();
  boolean isChangingConfigurations = activity != null && activity.isChangingConfigurations();
  if (isChangingConfigurations) {
    messageLoaderHelper.onDestroyChangingConfigurations();
    return;
  }
  messageLoaderHelper.onDestroy();
}

代码示例来源:origin: bluelinelabs/Conductor

@Override
protected void onDestroyView(@NonNull View view) {
  if (!getActivity().isChangingConfigurations()) {
    viewPager.setAdapter(null);
  }
  tabLayout.setupWithViewPager(null);
  super.onDestroyView(view);
}

代码示例来源:origin: konmik/nucleus

@Override
  public void onDestroy() {
    super.onDestroy();
    presenterDelegate.onDestroy(!getActivity().isChangingConfigurations());
  }
}

代码示例来源:origin: bluelinelabs/Conductor

final void activityDestroyed(@NonNull Activity activity) {
  if (activity.isChangingConfigurations()) {
    detach(view, true, false);
  } else {
    destroy(true);
  }
  if (isContextAvailable) {
    List<LifecycleListener> listeners = new ArrayList<>(lifecycleListeners);
    for (LifecycleListener lifecycleListener : listeners) {
      lifecycleListener.preContextUnavailable(this, activity);
    }
    isContextAvailable = false;
    onContextUnavailable();
    listeners = new ArrayList<>(lifecycleListeners);
    for (LifecycleListener lifecycleListener : listeners) {
      lifecycleListener.postContextUnavailable(this);
    }
  }
}

代码示例来源:origin: konmik/nucleus

@Override
  protected void onDetachedFromWindow() {
    super.onDetachedFromWindow();
    presenterDelegate.onDropView();
    presenterDelegate.onDestroy(!getActivity().isChangingConfigurations());
  }
}

代码示例来源:origin: konmik/nucleus

public void setUpIsFinishing(boolean b) {
  Activity activity = mock(Activity.class);
  when(activity.isFinishing()).thenReturn(b);
  when(activity.isChangingConfigurations()).thenReturn(!b);
  stub(method(BASE_VIEW_CLASS, "getContext")).toReturn(activity);
}

代码示例来源:origin: konmik/nucleus

public void setUpIsFinishing(boolean b) {
  Activity activity = mock(Activity.class);
  when(activity.isFinishing()).thenReturn(b);
  when(activity.isChangingConfigurations()).thenReturn(!b);
  stub(method(BASE_VIEW_CLASS, "getActivity")).toReturn(activity);
}

代码示例来源:origin: com.uphyca/android-junit4-robolectric

/**
 * @return
 * @see android.app.Activity#isChangingConfigurations()
 */
public boolean isChangingConfigurations() {
  return mActivity.isChangingConfigurations();
}

代码示例来源:origin: iqiyi/Neptune

@Override
public boolean isChangingConfigurations() {
  return mOriginActivity.isChangingConfigurations();
}

代码示例来源:origin: RuffianZhong/Rx-Mvp

/**
 * 是否保留V&P实例
 *
 * @return
 */
private static boolean retainVPInstance(Activity activity) {
  return activity.isChangingConfigurations() || !activity.isFinishing();
}

代码示例来源:origin: ManbangGroup/Phantom

@Override
  public boolean isChangingConfigurations() {
    return mContentProxy.getContext().isChangingConfigurations();
  }
}

代码示例来源:origin: AppStoreFoundation/asf-sdk

@Override public void onActivityPaused(Activity activity) {
 // if we're changing configurations we aren't going background so
 // no need to schedule the check
 if (!activity.isChangingConfigurations()) {
  // don't prevent activity being gc'd
  final WeakReference<Activity> ref = new WeakReference<>(activity);
  handler.postDelayed(check = () -> onActivityClosed(ref.get()), CHECK_DELAY);
 }
}

代码示例来源:origin: RuffianZhong/Rx-Mvp

/**
 * 是否保留V&P实例
 *
 * @return
 */
private static boolean retainVPInstance(Activity activity, Fragment fragment) {
  if (activity.isChangingConfigurations()) {
    return false;
  }
  if (activity.isFinishing()) {
    return false;
  }
  return !fragment.isRemoving();
}

代码示例来源:origin: com.squareup.assertj/assertj-android

@TargetApi(HONEYCOMB)
public S isNotChangingConfigurations() {
 isNotNull();
 assertThat(actual.isChangingConfigurations()) //
   .overridingErrorMessage("Expected not to be changing configurations but was changing.") //
   .isFalse();
 return myself;
}

代码示例来源:origin: com.squareup.assertj/assertj-android

@TargetApi(HONEYCOMB)
public S isChangingConfigurations() {
 isNotNull();
 assertThat(actual.isChangingConfigurations()) //
   .overridingErrorMessage("Expected changing configurations but was not changing.") //
   .isTrue();
 return myself;
}

代码示例来源:origin: sockeqwe/mosby-conductor

/**
 * Determines whether or not a Presenter Instance should be kept
 *
 * @param keepPresenterInstance true, if the delegate has enabled keep
 */
static boolean retainPresenterInstance(boolean keepPresenterInstance, Controller controller) {
 return keepPresenterInstance && (controller.getActivity().isChangingConfigurations()
   || !controller.getActivity().isFinishing()) && !controller.isBeingDestroyed();
}

代码示例来源:origin: MRezaNasirloo/Slick

private void destroy(@Nullable Activity activity) {
  if (activity == null || !activity.isChangingConfigurations()) {
    if (!hasOnViewDownCalled) onDetach(null);
    //noinspection ConstantConditions
    presenter.onDestroy();
    if (listener != null) {
      listener.onDestroy(id);
    }
    presenter = null;
  }
}

相关文章

Activity类方法