本文整理汇总了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());
}