I get this error in the line below in my Alarm module receiver in a B4XPage Project.
It occours when I check if the hour is setting in the KeyValueStore to the scheduling alarm.
I initializated the KVS in the B4XMainPage.
Due this information from Erel:
"Don't try to access B4XPages from FirebaseMessaging service. B4XPages can only be created after the main activity was created."
I tried to initializated the KVS in the Starter and get this error:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.Cursor anywheresoftware.b4a.sql.SQL.ExecQuery2(java.lang.String, java.lang.String[])' on a null object reference
It not happens in an Activity project.
How can I check the values setting the the KVS in the Alarm module in a B4XPages project?
B4X:
Dim horanot As Double
If B4XPages.MainPage.kvs.GetDefault("hour_1", "08:00").As(String).Length > 1 Then
horanot = Starter.kvs.GetDefault("hour_1", "08:00").As(String).SubString2(0,2)
End If
Dim t As Long
t = FindNextTime(Array As Double(horanot,12,18))
I initializated the KVS in the B4XMainPage.
Due this information from Erel:
"Don't try to access B4XPages from FirebaseMessaging service. B4XPages can only be created after the main activity was created."
I tried to initializated the KVS in the Starter and get this error:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.Cursor anywheresoftware.b4a.sql.SQL.ExecQuery2(java.lang.String, java.lang.String[])' on a null object reference
It not happens in an Activity project.
How can I check the values setting the the KVS in the Alarm module in a B4XPages project?