I'm writing an AIR Native Extension that has to do some work on a new Android Thread. I have to use a Context to get device information in this Thread. I am calling the getActivity method of FREContext in a new thread, which segfaults.
In my FREContext-extended class, I have:
public class MyExtensionContext extends FREContext {
public void doThreadWork() {
new Thread(new Runnable() {
@Override
public void run() {
// calling com.adobe.fre.FREContext.getActivity(), crashes here
Activity act = getActivity();
}
}
}
}
According to the Adobe documentation, FREObjects are not allowed to be accessed outside the FREFunction thread that's running. Is there a similar case with FREContext and new threads?