I have declared an variable of type Map within a Type structure;
B4X:
Type Request(WebRequest as String, WebParams As Map)
Dim UserRequest as Request
Request.WebRequest = "Test"
Request.WebParams.Initialize
The issue I'm having is on the 2nd line - the Initialize. I get an error;
B4X:
java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.objects.collections.Map.Initialize()' on a null object reference
I'm obviously doing something wrong but, not sure what. Is that kind of declaration even permitted?
Type Request(WebRequest as String, WebParams As Map)
Dim UserRequest as Request
UserRequest.initialize 'init the variable instance
UserRequest.WebRequest = "Test"
UserRequest.WebParams.Initialize 'init the field of the variable instance