Hello!
In Java part of my application I have two classes. In first one I implemented “com.naef.jnlua.NamedJavaFunction” and on invoke method call the “call” method of it’s second class. On “call” function I wrote following code:
public static void call(final int status){ System.out.println(" calling checkAvailablityCallback function !!!!"); final com.ansca.corona.CoronaRuntimeTaskDispatcher dispatcher = new com.ansca.corona.CoronaRuntimeTaskDispatcher(state); com.ansca.corona.CoronaEnvironment.getCoronaActivity().runOnUiThread(new Runnable() { @Override public void run() { com.ansca.corona.CoronaRuntimeTask task = new com.ansca.corona.CoronaRuntimeTask() { @Override public void executeUsing(com.ansca.corona.CoronaRuntime runtime) { com.naef.jnlua.LuaState luaState = runtime.getLuaState(); luaState.rawGet(com.naef.jnlua.LuaState.REGISTRYINDEX, luaFunctionReferenceKey); luaState.unref(com.naef.jnlua.LuaState.REGISTRYINDEX, luaFunctionReferenceKey); state.pushInteger(status); luaState.call(1, 0); } }; dispatcher.send(task); } }); }
But sometimes I get the following error in corona while my application didn’t destroy or dispose at all.
“CoronaRuntimeTaskDispatcher.send() doesn’t have an available Corona Runtime to run this task on! Abort!”
Can you explain why I will get this message? I can’t figure out how prevent this.
Thanks for your consideration.