Java listeners not working in a plugin's LuaLoader, but work in MainActivity.java

This is something that I had encountered in the past when adding an SDK to our game. I’d assumed it was a quirk of how that SDK worked, but now I’ve found the same thing in another SDK.

Here is a very simplified version of what I would expect to work:

import com.theSDK.\*; public class LuaLoader implements JavaFunction, CoronaRuntimeListener, theSDKListener{ @Override public void theSDKListenerCallback(String someMessage) { Log.d("Corona", "You will never see this message!"); } }

The SDK has a class to implement, and one of the things it has is a callback function of some kind which needs to be overridden to do whatever I need it to. Fairly simple, and for some plugins it’s worked just fine.  

However on these 2 occasions I’ve found that the callbacks never get triggered, nor is there any error. If I subclass the main corona activity and add the SDK to that in exactly the same way as I do the plugin luaLoader, then it works:

import com.theSDK.\*; public class QuizTixCoronaActivity extends CoronaActivity implements theSDKListener{ @Override public void theSDKListenerCallback(String someMessage) { Log.d("Corona", "Here is your callback message"); } }

For integrating these SDKs into our app this is not a huge problem, however if we wanted to create plugins for other people to use then I need to know why it doesn’t work when put into a plugin file.

Is there something that means this is simply not possible? Someone I spoke to from one of the SDKs said that “You can’t wrap an activity.   you can only subclass them.”, so I’m not sure if this is where the problem lies.