Android Question Camera2 autofocus and CreateObject2 function

Drago Bratko

Active Member
Licensed User
Longtime User
With this code:
B4X:
Dim Ref1 As Reflector
              
Dim MRWeight As Int = 1000
Dim MRArea As Rect
MRArea.Initialize(100, 100, 400, 400)
              
Dim params() As Object = Array As Object(MRArea, MRWeight)
Dim types() As Object = Array As String("android.graphics.Rect", "java.lang.int")
Ref1.Target = Ref1.CreateObject2("android.hardware.camera2.params.MeteringRectangle", params, types)

I get this result:
Untitled.png


So, object Ref1.Target is empty (or null or blank, whatever that means).
If I send invalid content in "params", tehn I get error, which is fine. But when I send it properly (I think it's correct), then I get empty.

Any ideas?
 

drgottjr

Expert
Licensed User
Longtime User
this works for me:
 

Attachments

  • cam.png
    cam.png
    13.2 KB · Views: 24
Upvote 0
Top