Hi Guys,
I am trying to, using B4XPages, create a KeyguardManager module, and getting partial results...
This is my current code:
using StartActivity(Intent) correctly shows the PatternLock screen, but I get no result...
If I use the commented out part Dim parent.... etc, I get an error stating that I am trying to call an intent that that does exist...
java.lang.RuntimeException: Method: startActivityForResult not found in: anywheresoftware.b4a.BALayout
My aim is to create a fallback if FingerPrint is not available/enrolled/notsupported which I have it working using the Biometrics Modeule found in the forum
https://www.b4x.com/android/forum/threads/fingerprint-authentication.72500/#content. I am using the Code Module because it allows me to place meaningfull log statements where I need them.
Any help would be appreciated in getting this module working...
I am trying to, using B4XPages, create a KeyguardManager module, and getting partial results...
This is my current code:
B4X:
Sub Class_Globals
Private mCallback As Object
Private mEvent As String
Private RequestCode As Int = 9876
End Sub
Public Sub Initialize(Callback As Object, EventName As String)
mCallback = Callback
mEvent = EventName.ToLowerCase
End Sub
Public Sub Show(Title As String, Message As String)
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim km As JavaObject = ctxt.RunMethod("getSystemService", Array("keyguard"))
Dim intent As Object = km.RunMethod("createConfirmDeviceCredentialIntent", Array(Title, Message))
If intent <> Null Then
StartActivity(intent)
' MUST use JavaObject + GetNativeParent in B4XPages
' Dim parent As Activity = B4XPages.GetNativeParent(B4XPages.MainPage)
'
' Dim jo As JavaObject = parent
' jo.RunMethod("startActivityForResult", Array(intent, RequestCode))
Else
CallSubDelayed2(mCallback, mEvent & "_complete", False)
End If
End Sub
' Called from Main.Activity_Result
Public Sub HandleActivityResult(rc As Int, result As Int)
If rc = RequestCode Then
CallSubDelayed2(mCallback, mEvent & "_complete",result)
End If
End Sub
using StartActivity(Intent) correctly shows the PatternLock screen, but I get no result...
If I use the commented out part Dim parent.... etc, I get an error stating that I am trying to call an intent that that does exist...
java.lang.RuntimeException: Method: startActivityForResult not found in: anywheresoftware.b4a.BALayout
My aim is to create a fallback if FingerPrint is not available/enrolled/notsupported which I have it working using the Biometrics Modeule found in the forum
https://www.b4x.com/android/forum/threads/fingerprint-authentication.72500/#content. I am using the Code Module because it allows me to place meaningfull log statements where I need them.
Any help would be appreciated in getting this module working...