package main;
import java.io.IOException;
import javax.microedition.lcdui.Image;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import de.enough.polish.ui.Display;
import de.enough.polish.ui.Displayable;
import de.enough.polish.ui.splash.ApplicationInitializer;
import de.enough.polish.ui.splash.InitializerSplashScreen;
public class Test extends MIDlet implements ApplicationInitializer {
private Display display;
private Profile g;
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub
}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void startApp() throws MIDletStateChangeException {
// TODO Auto-generated method stub
display = Display.getDisplay(this);
if(g!=null)
{
g.show("ff");
}
else
{
loadSplash();
}
}
private void loadSplash() throws MIDletStateChangeException {
try{
Image image = Image.createImage("/welcome.png");
int backgroundColor = 0xFFFFFF;
String readyMessage =null;// "Press any key to continue...";
//Set readyMessage = null to forward to the next
//displayabe as soon as it's available
int messageColor = 0xFF0000;
InitializerSplashScreen splashScreen = new InitializerSplashScreen(display,image, backgroundColor, readyMessage,messageColor,this);
this.display.setCurrent(splashScreen);
}catch(IOException e){
throw new MIDletStateChangeException("Unable to load splash image");
}
}
public Displayable initApp() {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
g=new Profile("hello",this);
return g;
}
}
|
My Blog Title
|