avacondios Active Member Licensed User Longtime User Jul 23, 2014 #1 On a class module, I have the following method : Code: Copy Public Sub Hide( MyActivity As Activity, MyActionBar As StdActionBar ) Dim mActionBar As tsActionbarMenu mActionBar.Initialize( MyActivity, MyActionBar ) mActionBar.Visible = False End Sub The compiler returns an activity context is required. This class (mActionBar) has a process context. (the mActionBar it has a process context) But this is only a method that I declared as a local variable (mActionBar). Why the compiler stops ? Is it a bug ? Last edited: Jul 23, 2014
On a class module, I have the following method : Code: Copy Public Sub Hide( MyActivity As Activity, MyActionBar As StdActionBar ) Dim mActionBar As tsActionbarMenu mActionBar.Initialize( MyActivity, MyActionBar ) mActionBar.Visible = False End Sub The compiler returns an activity context is required. This class (mActionBar) has a process context. (the mActionBar it has a process context) But this is only a method that I declared as a local variable (mActionBar). Why the compiler stops ? Is it a bug ?
Erel B4X founder Staff member Licensed User Longtime User Jul 23, 2014 #2 What is tsActionbarMenu? It probably requires an activity context. This means that your class should also be an "activity object". You can add Private DummyButton As Button to Class_Globals to cause the compiler to mark it as an activity object. Upvote 0
What is tsActionbarMenu? It probably requires an activity context. This means that your class should also be an "activity object". You can add Private DummyButton As Button to Class_Globals to cause the compiler to mark it as an activity object.