Example usage for android.app Activity getChangingConfigurations

List of usage examples for android.app Activity getChangingConfigurations

Introduction

In this page you can find the example usage for android.app Activity getChangingConfigurations.

Prototype

public int getChangingConfigurations() 

Source Link

Document

If this activity is being destroyed because it can not handle a configuration parameter being changed (and thus its #onConfigurationChanged(Configuration) method is not being called), then you can use this method to discover the set of changes that have occurred while in the process of being destroyed.

Usage

From source file:io.lqd.sdk.Liquid.java

@SuppressLint("NewApi")
private boolean isApplicationInBackground(Activity activity) {
    boolean configurationChanged;
    if (Build.VERSION.SDK_INT < 11) {
        int changingConfigs = activity.getChangingConfigurations();
        configurationChanged = (changingConfigs == Configuration.SCREENLAYOUT_LAYOUTDIR_RTL
                || changingConfigs == Configuration.SCREENLAYOUT_LAYOUTDIR_LTR);
    } else {/*from  www  . j av a  2 s.  c  om*/
        configurationChanged = activity.isChangingConfigurations();
    }
    return mAttachedActivities.size() == 0 && !configurationChanged;
}