FileDocCategorySizeDatePackage
AppGlobals.javaAPI DocAndroid 5.1 API2050Thu Mar 12 22:22:10 GMT 2015android.app

AppGlobals

public class AppGlobals extends Object
Special private access for certain globals related to a process.
hide

Fields Summary
Constructors Summary
Methods Summary
public static ApplicationgetInitialApplication()
Return the first Application object made in the process. NOTE: Only works on the main thread.

        return ActivityThread.currentApplication();
    
public static java.lang.StringgetInitialPackage()
Return the package name of the first .apk loaded into the process. NOTE: Only works on the main thread.

        return ActivityThread.currentPackageName();
    
public static intgetIntCoreSetting(java.lang.String key, int defaultValue)
Gets the value of an integer core setting.

param
key The setting key.
param
defaultValue The setting default value.
return
The core settings.

        ActivityThread currentActivityThread = ActivityThread.currentActivityThread();
        if (currentActivityThread != null) {
            return currentActivityThread.getIntCoreSetting(key, defaultValue);
        } else {
            return defaultValue;
        }
    
public static android.content.pm.IPackageManagergetPackageManager()
Return the raw interface to the package manager.

return
The package manager.

        return ActivityThread.getPackageManager();