【发布时间】:2014-08-02 22:55:07
【问题描述】:
我创建了一个接口类:
package userclasses;
import com.codename1.system.NativeInterface;
public interface NativeJ2MEInterface extends NativeInterface {
public void pollBackground();
}
这是原生类 - 在我编辑后:
package userclasses;
import userclasses.StateMachine;
public class NativeJ2MEInterfaceImpl {
public void pollBackground() {
try {
Date now = new Date();
long timeToRun = now.getTime() + (1000 * 60 );
System.out.println("RUNNNNNNN forest runnn!");
PushRegistry.registerAlarm(StateMachine.class.getName(), timeToRun);
}
catch (Exception e) {
System.out.println("EXC-1:"+e.getMessage());
}
}
public boolean isSupported() {
return true;
}
}
我想调用 javax.microedition.io.PushRegistry registerAlarm 方法,但我的 Codename One J2ME 构建失败,提示:
error: cannot find symbol
PushRegistry.registerAlarm(StateMachine.class.getName(), timeToRun);
我在本地 j2me 目录中添加了一个 midp_2.1.jar,但它不起作用。 我怎样才能让它工作?或者如何直接访问j2me报警API?
【问题讨论】:
标签: java-me native codenameone