Java Question Array of Strings and Null

Roger Garstang

Well-Known Member
Licensed User
Longtime User
I created a library that shows an alert dialog with a list populated from a String Array. It works fine and I put code in to even check for the selected item being null. It appears with B4A this condition would never happen though.

If I pass in Array As String("Victim", "Suspect", "Witness", Null) or create an String array manually with an item set to Null it appears to treat it like Array As String("Victim", "Suspect", "Witness", "null"). If I manually create it and don't provide/set an item it appears to treat it like Array As String("Victim", "Suspect", "Witness", "").

So, is it ok to assume B4A will never allow an item in an array to be null and remove the code I have to check for it? I had actually planned on using it to make a blank item that when clicked would reset the selection to -1, but that part doesn't work with this either, so I can remove that code too if the above is true.
 
Top