备份作参考,注意切换时的白屏等问题
public void switchCanvas(int id) {
curCanvasId = id;
if (curCanvasId == 1) {
canvas_1 = new ScreenManager_1();
dataManager = new DataManager_1(null/** this.getAppProperty("MIDlet-Version"* )*/);
dataManager.load();
// reset SPAC system
if (DeviceConstants_1.SPAC_ENABLE) {
SpacFile_1.resetImageCache();
}
// comment this before making iphone build
// canvas_1.setFullScreenMode(true);
Display.getDisplay(this).setCurrent(canvas_1);
gcWait(100);
canvas_1.start();
if (DeviceConstants_1.CALL_SHOW_NOTIFY_ON_STARTAPP)
{
if (canvas_1 != null)
{
canvas_1.showNotify();
}
}
cleanMenuCanvas();
} else if (curCanvasId == 2) {
canvas_2 = new GameCanvas();
Display.getDisplay(this).setCurrent(canvas_2);
gcWait(100);
if (LicenseHandler.LICENSE_HANDLER_SUPPORTED) {
if (canvas_2.isRecurring(this) && !validated
&& canvas_2.validateLicense(this, canvas_2)) {
validated = true;
Display.getDisplay(this).setCurrent(canvas_2);
canvas_2.start();
} else if (!canvas_2.isRecurring(this)) {
Display.getDisplay(this).setCurrent(canvas_2);
canvas_2.start();
}
} else {
canvas_2.start();
}
cleanMenuCanvas();
}
}