本文整理匯總了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);
}
示例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();
}
示例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();
}
示例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();
}
示例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());
}
}
}
示例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());
}
示例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();
}
示例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);
}
}
}
}
示例9: onActivityPaused
import android.app.Activity; //導入方法依賴的package包/類
@Override
public void onActivityPaused(Activity activity) {
isChangingConfigurations = activity.isChangingConfigurations();
}
示例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());
}