English 中文(简体)
发出呼吁后恢复参与者
原标题:Resume player when incoming call

我希望,在即将到来的电话线之后,从点起继续。

I use this code:

public void playerUpdate(Player player, String event, Object data) {

    if(event == PlayerListener.DEVICE_UNAVAILABLE) {
        player.stop();
        isPause = true;     
    }
    if(event == PlayerListener.DEVICE_AVAILABLE) {


        if(isPause == true) {

            player.start();


        }
    }

}

但这只是工作。 轨道重启。

最佳回答

请不要更新运动员的代码,而是使用一种包裹价值,当电话自动中断时,可以隐藏Notify()和节省媒体时间(有)并恢复参与者,采用显示器法和改变血压价值,开始();参与者。

这里是一部法典。

protected void hideNotify() {        

    resume = false;
    paintMessage = false;


    mediaTime = player.getMediaTime();
}

// calls while resuming the application.

protected void showNotify() {
    if (mediaTime != 0) {
        if (pause) {

            resume = false;


            midlet.lcduiDisplay.callSerially(repainter);
            mediaTime = player.getMediaTime();
            pausePlayer();
        } else {


            resume = true;


            long med = mediaTime / 1000;
            med = med / 1000;
            message = "Resuming...from " + med;

            play(mediaTime);
        }
    }
}
问题回答

暂无回答




相关问题
add text in http request string url

ok i made a midlet through which i can connect to server pages and get soem information as response. For example i made a midlet through which i acced url: http://example.com/?u=nepal&t=1 Now i ...

Do I have to do a setSize() on a Vector before using it?

Given private final Vector v = new Vector(); //instance variable the following 3 lines are in an instance method in the same class. 1. int length = v.capacity(); 2. int size = v.size(); ...

Is the situation with Java ME improving?

It seems to be the consensus that developing for Java ME is not as cross platform as you might expect, particularly compared to say java SE, but it is difficult to assess how the situation is evolving....

Privileged operations in netbeans mobility

I m writing a Java ME app that will use privileged operations such as messaging. By default the user is prompted to confirm each of these operations, but I would like to run it as a background ...

ClassFormatError: 56 while using hessian in j2me

I am trying to use the hessian j2me implementation @ http://hessian.caucho.com/ using java me sdk 3.0. http://hessian.caucho.com/doc/hessian-overview.xtp#Hessian%20Client%20for%20a%20cell-phone ...

热门标签