FileDocCategorySizeDatePackage
BridgeAssetManager.javaAPI DocAndroid 1.5 API2610Wed May 06 22:42:02 BST 2009com.android.layoutlib.bridge

BridgeAssetManager

public class BridgeAssetManager extends android.content.res.AssetManager

Fields Summary
Constructors Summary
private BridgeAssetManager()

    
Methods Summary
static voidclearSystem()
Clears the static {@link AssetManager#mSystem} to make sure we don't leave objects around that would prevent us from unloading the library.

        AssetManager.mSystem = null;
    
static android.content.res.AssetManagerinitSystem()
This initializes the static field {@link AssetManager#mSystem} which is used by methods who get a global asset manager using {@link AssetManager#getSystem()}.

They will end up using our bridge asset manager.

{@link Bridge} calls this method after setting up a new bridge.

        if (!(AssetManager.mSystem instanceof BridgeAssetManager)) {
            // Note that AssetManager() creates a system AssetManager and we override it
            // with our BridgeAssetManager.
            AssetManager.mSystem = new BridgeAssetManager();
            AssetManager.mSystem.makeStringBlocks(false);
        }
        return AssetManager.mSystem;
    
public voidsetConfiguration(int mcc, int mnc, java.lang.String locale, int orientation, int touchscreen, int density, int keyboard, int keyboardHidden, int navigation, int screenWidth, int screenHeight, int version)
Change the configuration used when retrieving resources. Not for use by applications.

        
        Configuration c = new Configuration();
        c.mcc = mcc;
        c.mnc = mnc;
        c.locale = new Locale(locale);
        c.touchscreen = touchscreen;
        c.keyboard = keyboard;
        c.keyboardHidden = keyboardHidden;
        c.navigation = navigation;
        c.orientation = orientation;