Android Question An Activity context is required Error

avacondios

Active Member
Licensed User
Longtime User
On a class module, I have the following method :

B4X:
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:
Top