当前位置: 首页>>代码示例>>Java>>正文


Java Activity.isChangingConfigurations方法代码示例

本文整理汇总了Java中android.app.Activity.isChangingConfigurations方法的典型用法代码示例。如果您正苦于以下问题:Java Activity.isChangingConfigurations方法的具体用法?Java Activity.isChangingConfigurations怎么用?Java Activity.isChangingConfigurations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.Activity的用法示例。


在下文中一共展示了Activity.isChangingConfigurations方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onActivityDestroyed

import android.app.Activity; //导入方法依赖的package包/类
@Override public void onActivityDestroyed(Activity activity) {
  if (!activity.isChangingConfigurations()) {
    // Activity will be destroyed permanently, so reset the cache
    String activityId = activityIdMap.get(activity);
    if (activityId != null) {
      ActivityScopedCache scopedCache = activityScopedCacheMap.get(activityId);
      if (scopedCache != null) {
        scopedCache.clear();
        activityScopedCacheMap.remove(activityId);
      }

      // No Activity Scoped cache available, so unregister
      if (activityScopedCacheMap.isEmpty()) {
        // All Mosby related activities are destroyed, so we can remove the activity lifecylce listener
        activity.getApplication()
            .unregisterActivityLifecycleCallbacks(activityLifecycleCallbacks);
        if (DEBUG) {
          Log.d(DEBUG_TAG, "Unregistering ActivityLifecycleCallbacks");
        }
      }
    }
  }
  activityIdMap.remove(activity);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:PresenterManager.java

示例2: retainPresenterInstance

import android.app.Activity; //导入方法依赖的package包/类
protected boolean retainPresenterInstance() {

    Activity activity = getActivity();
    if (activity.isChangingConfigurations()) {
      return keepPresenterInstanceDuringScreenOrientationChanges;
    }

    if (activity.isFinishing()) {
      return false;
    }

    if (keepPresenterOnBackstack && BackstackAccessor.isFragmentOnBackStack(fragment)) {
      return true;
    }

    return !fragment.isRemoving();
  }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:FragmentMvpDelegateImpl.java

示例3: retainPresenterInstance

import android.app.Activity; //导入方法依赖的package包/类
private boolean retainPresenterInstance(boolean keepPresenterOnBackstack, Activity activity,
    Fragment fragment) {

  if (activity.isChangingConfigurations()) {
    if (keepPresenterDuringScreenOrientationChange) {
      return true;
    }
    return false;
  }

  if (activity.isFinishing()) {
    return false;
  }

  if (keepPresenterOnBackstack && BackstackAccessor.isFragmentOnBackStack(fragment)) {
    return true;
  }

  return !fragment.isRemoving();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:FragmentMviDelegateImpl.java

示例4: retainPresenterInstance

import android.app.Activity; //导入方法依赖的package包/类
protected boolean retainPresenterInstance() {

        Activity activity = getActivity();
        if (activity.isChangingConfigurations()) {
            return keepPresenterInstanceDuringScreenOrientationChanges;
        }

        if (activity.isFinishing()) {
            return false;
        }

//        if (keepPresenterOnBackstack && BackstackAccessor.isFragmentOnBackStack(fragment)) {
//            return true;
//        }

        return !fragment.isRemoving();
    }
 
开发者ID:Loofer,项目名称:Watermark,代码行数:18,代码来源:FragmentMvpDelegateImpl.java

示例5: onActivityStopped

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onActivityStopped(Activity activity) {
    if (DBG) Log.d(TAG, "onActivityStopped:" + activity);
    int activityKey = System.identityHashCode(activity);
    synchronized (sStartedActivities) {
        boolean foregroundOld = isForeGround();
        sStartedActivities.remove(activityKey);
        sChangingConfiguration = activity.isChangingConfigurations();
        if (!sChangingConfiguration) {
            boolean foregroundNew = isForeGround();
            if (foregroundNew != foregroundOld)
                notifyListener(activity, foregroundNew);
            if (DBG) Log.d(TAG, "isForeGround:" + isForeGround());
        }
    }
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:17,代码来源:AppState.java

示例6: onActivityStopped

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onActivityStopped(Activity activity) {
    WebtrekkLogging.log("Tracking Activity stopped: " + getActivityName(activity) + " instance hash:" + activity.hashCode() + (activity.isFinishing() ? " as finishing" : " as sleeping"));
    WebtrekkLogging.log("CurrentStatus before:"+mCurrentStatus+ " Current Activity:"+mCurrentActivityName + " Previous Activity:"+mPreviousActivitiesQueue.peek());
    if (activity.isFinishing()) {
        //activity is finishing increase activity counter and determine applicaiton shut down
        mCurrentActivitiesCount--;
        if (mCurrentActivitiesCount == 0 || (mFirstActivityName != null && mFirstActivityName.equals(getActivityName(activity))))
            mCurrentStatus = STATUS.SHUT_DOWNING;
    }else
    {
        // if this is not finishing activity and there is no any new activity started that is go to background process
        String stoppedActivity = getActivityName(activity);
        if (stoppedActivity.equals(mCurrentActivityName) && !activity.isChangingConfigurations() && (mCurrentActivityInstance == null || activity == mCurrentActivityInstance.get()))
        {
            mCurrentStatus = STATUS.GOING_TO_BACKGROUND;
            mLastActivityVisibleTime = System.currentTimeMillis();
        }
    }
    WebtrekkLogging.log("CurrentStatus after:"+mCurrentStatus + " Current Activity:"+mCurrentActivityName + " Previous Activity:"+mPreviousActivitiesQueue.peek());
}
 
开发者ID:Webtrekk,项目名称:webtrekk-android-sdk,代码行数:22,代码来源:ActivityTrackingStatus.java

示例7: onDestroy

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onDestroy() {
    super.onDestroy();

    Activity activity = getActivity();
    boolean isChangingConfigurations = activity != null && activity.isChangingConfigurations();
    if (isChangingConfigurations) {
        messageLoaderHelper.onDestroyChangingConfigurations();
        return;
    }

    messageLoaderHelper.onDestroy();
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:14,代码来源:MessageViewFragment.java

示例8: onActivityStopped

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onActivityStopped(Activity activity) {
    if (filter == null || !filter.isIgnore(activity)) {
        if (activity.isChangingConfigurations()) {
            bufferCount--;
        } else {
            foregroundCount--;
            if (foregroundCount <= 0) {
                dispatchApplicationEnterBackground(activity);
            }
        }
    }
}
 
开发者ID:TakWolf,项目名称:Android-Foreback,代码行数:14,代码来源:Foreback.java

示例9: onActivityPaused

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onActivityPaused(Activity activity) {
  isChangingConfigurations = activity.isChangingConfigurations();
}
 
开发者ID:kardeslik,项目名称:life-of-app,代码行数:5,代码来源:AppLifecycleManager.java

示例10: retainPresenterInstance

import android.app.Activity; //导入方法依赖的package包/类
/**
 * Determines whether or not a Presenter Instance should be kept
 *
 * @param keepPresenterInstance true, if the delegate has enabled keep
 */
static boolean retainPresenterInstance(boolean keepPresenterInstance, Activity activity) {
  return keepPresenterInstance && (activity.isChangingConfigurations()
      || !activity.isFinishing());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:ActivityMvpDelegateImpl.java


注:本文中的android.app.Activity.isChangingConfigurations方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。