Android Question Error in BiometricManager class

cxbs

Active Member
Licensed User
Longtime User
Dear Mr. Erel

The error occurs inside BiometricManager

I want to add fingerprint verification in the child Activity

B4X:
Public Sub Show (Msg As String,Cancel As String)
    Dim PromptInfoBuilder As JavaObject
    PromptInfoBuilder.InitializeNewInstance("androidx.biometric.BiometricPrompt$PromptInfo$Builder", Null)
    PromptInfoBuilder.RunMethod("setTitle", Array(Msg))
    PromptInfoBuilder.RunMethod("setNegativeButtonText", Array(Cancel))
    Dim Ev As JavaObject
    Ev.InitializeNewInstance(Application.PackageName & ".biometricmanager.BiometricPromptAuthentication", Array(Me))
    Dim Prompt As JavaObject
    Prompt.InitializeNewInstance("androidx.biometric.BiometricPrompt", Array(ctxt, Executor, Ev))
    Prompt.RunMethod("authenticate", Array(PromptInfoBuilder.RunMethod("build", Null)))
   
End Sub

The error occurrs in this line "Prompt.InitializeNewInstance("androidx.biometric.BiometricPrompt", Array(ctxt, Executor, Ev))"


java.lang.RuntimeException: Constructor not found.
at anywheresoftware.b4j.object.JavaObject.InitializeNewInstance(JavaObject.java:94)
at b4a.example.biometricmanager._show(biometricmanager.java:152)
at b4a.example.login$ResumableSub_btnAuth_Click.resume(login.java:427)
at b4a.example.login._btnauth_click(login.java:403)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7145)
at android.view.View.performClickInternal(View.java:7122)
at android.view.View.access$3500(View.java:810)
at android.view.View$PerformClick.run(View.java:27403)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7520)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
 

Attachments

  • BiometricManager.zip
    5.5 KB · Views: 285
Last edited:

cxbs

Active Member
Licensed User
Longtime User
1. You should use File - Export as zip when uploading projects.
2. Moved to the questions forum.
3. See the instructions. You need to add this line to the activity that calls bm.Show:
B4X:
#Extends: android.support.v4.app.FragmentActivity
Dear Mr. Erel
Thank you!
 
Upvote 0
Top