i need help
for my android lib i need init my class in b4a with a android.content.Context
because GLSurfaceView have this in the constructor.
android library part in android studio
B4X:
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.view.View;
@ShortName("ThreeDimensional")
public class ThreeDimensional {
private GLSurfaceView glView; // use GLSurfaceView
public View Init(Context context)
{
glView = new GLSurfaceView(context); // Allocate a GLSurfaceView
glView.setRenderer(new MyGLRenderer(context)); // Use a custom renderer
return glView;
}
what is ba. ? what lib does it comes from?
i not using any b4a system related libs in my android studio library project.
this ba.context i need in b4a project compatible/equal with android.content.Context
Sub GetContext As JavaObject
Return GetBA.GetField("context")
End Sub
Sub GetBA As JavaObject
Dim jo As JavaObject
Dim cls As String = Me
cls = cls.SubString("class ".Length)
jo.InitializeStatic(cls)
Return jo.GetFieldJO("processBA")
End Sub
what is ba. ? what lib does it comes from?
i not using any b4a system related libs in my android studio library project.
this ba.context i need in b4a project compatible/equal with android.content.Context
public View Init(Context context)
should be
public View Init(BA ba)
The ba parameter won't be visible for the B4A user but it will be automatically filled when the function is called, allowing to get the context or the activity, and to raise B4A events.