I get the following error in a class module:
It seems that this error occurs if I just call a sub in a code module (here Util.GetText). Util.GetText uses only AHTranslator object which is declared as process global variable. So I don't think that an activity context is needed here.
I can fix this with adding a dummy panel to the class which is never used. But I don't know why the compiler needs activity context.
Sorry, I currently don't have a small example project for the issue.
Edit: Hmm, in this context I can't add a dummy panel because I need an instance of this class as process globals variable.
B4X:
Compiling code. Error
Error compiling program.
Error description: An Activity context is required.
This class has a process context.
Adding a global "Activity object" variable will fix this issue.
Occurred on line: 51
UpdateInterval.Put(C.PREFS_UPDINTERVAL_30M, Util.GetText("30 minutes"))
Word: gettext
It seems that this error occurs if I just call a sub in a code module (here Util.GetText). Util.GetText uses only AHTranslator object which is declared as process global variable. So I don't think that an activity context is needed here.
I can fix this with adding a dummy panel to the class which is never used. But I don't know why the compiler needs activity context.
Sorry, I currently don't have a small example project for the issue.
Edit: Hmm, in this context I can't add a dummy panel because I need an instance of this class as process globals variable.
Last edited: