У меня есть общий пул, который я делаю здесь:
public class FruitPool extends GenericPool<Sprite> {
// ===========================================================
// Constants          
// ===========================================================
// ===========================================================          
// Fields         
// =========================================================== 
private final TextureRegion mTextureRegion;
private Scene mScene;
// ===========================================================          
// Constructors          
// =========================================================== 
public FruitPool(final TextureRegion pFruitTextureRegion, Scene mScene2) {
    this.mTextureRegion = pFruitTextureRegion;
    this.mScene = mScene2;
}
// ===========================================================          
// Getter & Setter          
// =========================================================== 
// ===========================================================          
// Methods for/from SuperClass/Interfaces          
// ===========================================================  
@Override
protected Sprite onAllocatePoolItem() {
     Random rand = new Random();
        //I want to get the Screens Display metrics here...
    Sprite fruit = new Sprite(0, 0, this.mTextureRegion);
    mScene.attachChild(fruit);
    return fruit;
}
Я пытаюсь заставить экраны отображать такие показатели.
    final Display display = getWindowManager().getDefaultDisplay();
    CAMERA_WIDTH = display.getWidth();
    CAMERA_HEIGHT = display.getHeight();
Единственная проблема заключается в том, что я не могу понять, как это сделать за пределами Activity.
Возможно ли это? Или мне придется использовать SharedPreference или что-то еще?