Hello, please help me find out where is MainActivity Class in Corona Native template.
I wanted to enable speechrecognition, but it gives me an erorr
No pending exception expected: java.lang.RuntimeException: SpeechRecognizer should be used only from the application’s main thread’
I thought it would be okey to run it in onLoaded method, just before main.lua starts but they say
it is not called on the main thread.
I tried to find any method that
is called on the main thread
and failed to find any.
Please, help me to move on.
private class CoronaRuntimeEventHandler implements com.ansca.corona.CoronaRuntimeListener {
/**
* Called after the Corona runtime has been created and just before executing the “main.lua” file.
* This is the application’s opportunity to register custom APIs into Lua.
* <p>
* Warning! This method is not called on the main thread.
* @param runtime Reference to the CoronaRuntime object that has just been loaded/initialized.
* Provides a LuaState object that allows the application to extend the Lua API.
*/
@Override
public void onLoaded(com.ansca.corona.CoronaRuntime runtime) {
…SPEECH DOES NOT WORK HERE
}