0 Replies Latest reply: Mar 31, 2010 10:03 PM by 807581 RSS

    Running Applications in background

    807581
      I am trying to make my application to start by push registry through alarm method and run the whole thing in the background.

      But no matter how i place my code, there will always be a blank white screen popping out and i don't seem to be able to get rid of it.

      I also tried taking out the switchDisplayable and display but no effect as well.

      Below is the main bulk of codes:

      public void startApp() {


      fileWriter.writeFile("Error log.txt", "Start\n");
      Display display = null;
      fileWriter.writeFile("Error log.txt", "Start2 \n");




      fileWriter.writeFile("Error log.txt", "After Display \n");

      try {

      Date now = new Date();
      long previous = now.getTime() ;
      fileWriter.writeFile("Error log.txt", "Start Push \n" + myDate(System.currentTimeMillis()) );

      PushRegistry.registerAlarm("AlarmMIDlet", System.currentTimeMillis() + 10000);

      display.setCurrent(null); // This line is used to set it to background//
      fileWriter.writeFile("Error log.txt", "hide \n");

      } catch (java.lang.ClassNotFoundException cnf) {

      fileWriter.writeFile("Error log.txt", "Class not Found \n");
      } catch (javax.microedition.io.ConnectionNotFoundException connnf) {

      fileWriter.writeFile("Error log.txt", "Connection Not Found \n");
      }

      notifyDestroyed();
      }