Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

CoronaRuntimeTaskDispatcher.send() doesn't have an available CoronaRuntime to run this task on! Abort!
Started by meister.public May 13 2018 05:43 PM

No replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

meister.public

[GLOBAL: userInfoPane.html]
meister.public
  • Observer

  • 9 posts
  • Corona SDK

I have a bluetooth plugin and the android code is generated the following error:

 

CoronaRuntimeTaskDispatcher.send() doesn't have an available CoronaRuntime to run this task on! Abort

From my research it has something to do with the Activity being deleted.

 

My plugin has an init function that takes a function, that function receives events from the bluetooth device.

 

 

private class init implements NamedJavaFunction {
@Override
public String getName() {
return "init";
}
@Override
public int invoke(final LuaState L) {
final int myRef = CoronaLua.newRef( L);
initL = L;
initDispatcher new CoronaRuntimeTaskDispatcher(L);
coronaActivity = CoronaEnvironment.getCoronaActivity();

 

 

The init function when invoked provides a LuaState, which I use to create a dispatcher, which I then use to send the events.

 

public void onMessage(byte[] mybytes) {
final byte[] bytes = mybytes;
initDispatcher.send( new CoronaRuntimeTask() {
@Override
public void executeUsing(CoronaRuntime runtime) {

LuaState L = runtime.getLuaState();

CoronaLua.newEvent(L, "bluetoothbytes");

 

...

try {
CoronaLua.dispatchEvent(L, myRef, 1);
} catch (Exception e) {
e.printStackTrace();
}
}
} );


}

 

 

I have exhausted my ability to figure this one out.  Any help would be appreciated.




[topic_controls]
[/topic_controls]