當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。