You should really inherit App from UiApplication (if it has some UI) or from Application (if it's background app, service).
If you have some Manager extension, place it into Screen extension.
Like this:
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;
public class CenterButtonPanelApp extends UiApplication {
public CenterButtonPanelApp() {
pushScreen(new Scr());
}
public static void main(String[] args) {
CenterButtonPanelApp app = new CenterButtonPanelApp();
app.enterEventDispatcher();
}
}
class Scr extends MainScreen {
public Scr() {
CenterButtonPanel centerPanel = new CenterButtonPanel();
add(centerPanel);
}
}
class CenterButtonPanel extends HorizontalFieldManager {
int mWidth = Display.getWidth();
public CenterButtonPanel() {
super(FIELD_HCENTER);
}
public int getPreferredWidth() {
return mWidth;
}
protected void sublayout(int maxWidth, int maxHeight) {
super.sublayout(mWidth, maxHeight);
setExtent(mWidth, maxHeight);
}
}