ddahan Member Licensed User Longtime User Mar 16, 2014 #1 Hi, I'm trying build a panel with his views and return it from a class module but I'm getting this error: Parsing code. 0.15 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: 216 SearchSVRowPnl.Initialize("") Word: initialize This concept works well on a small example , but on the big project it fails. I have found a work around that resolve the issue here: http://www.b4x.com/android/forum/th...s-when-no-activity-context-is-required.19300/ I'm wondering if this issue is still B4A bug or a code issue. Thanks, David.
Hi, I'm trying build a panel with his views and return it from a class module but I'm getting this error: Parsing code. 0.15 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: 216 SearchSVRowPnl.Initialize("") Word: initialize This concept works well on a small example , but on the big project it fails. I have found a work around that resolve the issue here: http://www.b4x.com/android/forum/th...s-when-no-activity-context-is-required.19300/ I'm wondering if this issue is still B4A bug or a code issue. Thanks, David.
Erel B4X founder Staff member Licensed User Longtime User Mar 16, 2014 #2 The bug discussed in that thread was fixed long ago. The problem is that the compiler treats your class as a process object. Add a global "ui" variable: Code: Copy Sub Class_Globals Private buttonToSetActivityContext As Button 'ignore End Sub The compiler will then treat your class context as an activity context. Upvote 0
The bug discussed in that thread was fixed long ago. The problem is that the compiler treats your class as a process object. Add a global "ui" variable: Code: Copy Sub Class_Globals Private buttonToSetActivityContext As Button 'ignore End Sub The compiler will then treat your class context as an activity context.
ddahan Member Licensed User Longtime User Mar 16, 2014 #3 Thanks for your fast response. is it the same solution as adding : Dim dummyView As View ? Upvote 0