Android Question Cast object to string with Hebrew letters

yaniv hanya

Active Member
Licensed User
I have a list that when I fill it in English values, at a click event I can get the value from the object and use it.
But when the values in the list are in Hebrew, the value remains as an object and I can't use it.
What should I do?
 

Attachments

  • b4a1.jpg
    b4a1.jpg
    62.4 KB · Views: 256
  • b4a2.jpg
    b4a2.jpg
    51 KB · Views: 232

yaniv hanya

Active Member
Licensed User
[Ljava.lang.String" is the Java type name for a single dimension array of Strings. Check that the Hebrew values are actually individual strings

You're right.
The code that filled the listview is the DBUtils.ExecuteListView function and in the light of your comments I checked the class and really it returns the values as an array.
And when I wrote

Dim s() As String=Value
signLb.Text=s(0)

it worked well.
thank you very much
 
Upvote 0

netsistemas

Active Member
Licensed User
Longtime User
I have a similar error when the file is not create from android (windows in this case)

I use this code for read a ini value.

B4X:
Sub ReadIni(key As String,fPath As String,filename As String) As Object  

    Dim Map1 As Map
    Dim Rt As Object
    'code added for read in file WINDOWS.
    Rt = ""
    '*********************************
       
    Map1.Initialize
    If File.Exists(fPath,filename) Then
     
    Else
          File.WriteMap(fPath, filename, Map1)   'to create it if not exist
       End If
   
   
    Map1 = File.ReadMap(fPath,filename)
    If Map1.Size = 0 Then
        Rt = ""
    Else
   
       For i = 0 To Map1.Size - 1
          If Map1.GetKeyAt(i) = key Then
             Rt = Map1.GetValueAt(i)
             Exit
          End If
        Next
    End If

    Return Rt
End Sub

i need insert a simple additional code:
B4X:
    Dim Rt As Object
    'code added for read in file WINDOWS.
    Rt = ""
    '*********************************


If you don't write this code,



the return value is:
java.lang.Object@607b729
 
Upvote 0

netsistemas

Active Member
Licensed User
Longtime User
Thats is true, very true, but this function are write for other person in this forum, and very year ago,i copy and paste in my code (run ok: don't touch!!!)
I will change my función, but this case are curiosly for me and i thing than other person can get similiar errors.
Thanks agraham (and thank for you printer class)
 
Upvote 0
Top