Android externals getEngineApi issue
Posted: Wed Jul 09, 2014 4:42 am
I've been banging my head against an issue with android externals where if the user used the back button to kill the app I couldn't instantiate a control on the next load of the app. I know android likes to keep variable instances hanging around and I thought the problem was with my external but after trying everything I could think of nothing worked. Then I thought... why not take a look to see if the issue is in Support.java. Lo and behold there's:
Now there's two ways around this. Either just call __InterfaceQueryEngine() every time or work out a way to nullify s_engine_api when the app is being killed. What's your preference? For the time being I'm just commenting out if(s_engine_api == null).
Code: Select all
private static EngineApi s_engine_api = null;
private static EngineApi getEngineApi()
{
if (s_engine_api == null)
s_engine_api = __InterfaceQueryEngine();
return s_engine_api;
}