문제

when running the program, music still running but console don't print the messenge. Where is the problem?

I don't use english well. Sorry.

public class MultimediaSound extends MIDlet {
      public void startApp(){
          try {
          Player player = Manager.createPlayer(getClass().
          getResourceAsStream("/tuner1.wav"),"audio/x-wav");

          player.start();
          player.addPlayerListener(new PlayerListener(){

            public void playerUpdate(Player arg0, String arg1, Object arg2) {
                if(arg1 == (PlayerListener.STARTED)){
                    System.out.print(arg2.toString()+" " + "dkm ");
                }else{
                    System.out.print("dkm                  ");
                }
            }

          });
          } catch(Exception e) {
          e.printStackTrace();
          }
          }

          public void pauseApp() {}

          public void destroyApp(boolean unconditional) {}
}
도움이 되었습니까?

해결책

arg1 is a string you should use

if(arg1.equals(PlayerListener.STARTED))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top