I've been using notification listener for a while now and I wonder how to run the method getCharSequenceArray outside of the notificationlistener service. I save the notification textLines in a string variable, but I can't find the way to run getCharSequenceArray to get back an array of strings.
I tried something like this
But always get an method not found error.
As a side note, the saved variable (textLinesSavedVariable) holds this text: [Ljava.lang.CharSequence;@bb00ae
I wonder what [Ljava.lang.CharSequence;@bb00ae means, if it is an address pointing somewhere into the ram memory maybe it would not make sense to save the data because whenever the phone GC delete that, I would not be available to get it back.
I tried something like this
B4X:
'textLinesSavedVariable is a string variable
Private JO As JavaObject
JO.InitializeContext
'JO.InitializeStatic("java.lang.Class") 'I tried different classes
Try
Dim lines() As Object = JO.RunMethod("getCharSequenceArray", Array(textLinesSavedVariable))
For Each line As Object In lines
Log(line)
Next
Catch
'LogColor("Error!", Colors.Red)
Log(LastException)
End Try
As a side note, the saved variable (textLinesSavedVariable) holds this text: [Ljava.lang.CharSequence;@bb00ae
I wonder what [Ljava.lang.CharSequence;@bb00ae means, if it is an address pointing somewhere into the ram memory maybe it would not make sense to save the data because whenever the phone GC delete that, I would not be available to get it back.
Last edited: