Android Question compile error: Code module do not support Me keyword

JWT

Member
Just a new B4J and B4A user, I have written a code module in B4J using the OKHttpUtils2 library for calling a couple of webservices in my IoT domotica project. That works fine in B4J, it's based on the B4A/B4X tutorial. But now I want to use this code module in my B4A Samsung Android app.
But compiling the code gives an error in the j.Initiliaze("", Me) statement: Code module do not support Me keyword
<code>
Sub PlugWiseSwitchenbyName(pStretchIP As String, pStretchUserName As String, pStretchPW As String, pApplianceName As String, actie As String) As ResumableSub ' schakelen van Plugwise circle, stealth en switch
Dim PostAdres As String = "http://" & pStretchIP & "/core/appliances;name=" & pApplianceName & "/relay"
Dim PostGegevens As String = "<relay><state>" & actie & "</state></relay>"
Dim stretchStatus As String = "-"
Dim ListItems As String
Dim j As HttpJob
j.Initialize("", Me)
j.Username= pStretchUserName
j.Password= pStretchPW
j.PostString(PostAdres, PostGegevens)
Wait For (j) JobDone (j As HttpJob)
If j.Success Then
stretchStatus = actie
Log(j.GetString)
ListItems = j.GetString
Else
stretchStatus = "error" & j.ErrorMessage
Log("Error " & j.ErrorMessage)
End If
j.Release
Return stretchStatus
End Sub ' PlugWiseSwitchenbyName
</code>

I searched the forums and documentation, but did not find any clues or answer.

What would be the best way to solve this, apart from copying the code in the main source?

best regards,
Jan Willem Teunisse
 

JWT

Member
OK, thanks, Erel. I will change it to a class module. For the moment I have copied the code in the main part of the app. And this works fine!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…