[android] IllegalStateException: Task already scheduled or cancelled
Closed this issue · 2 comments
thomasuster commented
Fatal Exception: java.lang.IllegalStateException: Task already scheduled or cancelled at java.util.Timer.sched + 401(Timer.java:401) at java.util.Timer.schedule + 193(Timer.java:193) at org.haxe.nme.MainView.HandleResult + 282(MainView.java:282) at org.haxe.nme.MainView.onPollHX + 291(MainView.java:291) at org.haxe.nme.MainView$1.run + 81(MainView.java:81) at android.opengl.GLSurfaceView$GLThread.guardedRun + 1500(GLSurfaceView.java:1500) at android.opengl.GLSurfaceView$GLThread.run + 1270(GLSurfaceView.java:1270)
thomasuster commented
public void HandleResult(int inCode)
{
if (inCode==resTerminate)
{
//Log.v("VIEW","Terminate Request.");
mActivity.onNMEFinish();
return;
}
double wake = NME.getNextWake();
int delayMs = (int)(wake * 1000);
if (renderPending && delayMs<5)
delayMs = 5;
if (delayMs<=1)
queuePoll();
else
{
if (pendingTimer!=null)
pendingTimer.cancel();
final MainView me = this;
pendingTimer = new TimerTask() {
@Override public void run() {
me.queuePoll();
}
};
mTimer.schedule(pendingTimer,delayMs); //<-- Line 282
}
}
thomasuster commented
haxelib run nme build android -gradle && adb install -r Export/android/DisplayingABitmap/app/build/outputs/apk/debug/app-x86-debug.apk