I have this code
name is aname of a file.
for some resone i hav a aproblem in the regex line and the code crash in the return comnd with this log
ted dont get initialized for some reason.
Why?
B4X:
If name.Contains(".") Then
Dim tde() As String=Regex.Split(".",name)
Return tde(tde.Length-1)
End If
for some resone i hav a aproblem in the regex line and the code crash in the return comnd with this log
Error occurred on line: 261 (ChooseFiles)
java.lang.ArrayIndexOutOfBoundsException: length=0; index=-1
at java.lang.reflect.Array.get(Array.java:170)
at anywheresoftware.b4a.shell.ArraysUtils.getElement(ArraysUtils.java:76)
at anywheresoftware.b4a.shell.Shell.getArrayElement(Shell.java:584)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:383)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at b4a.example.choosefiles._getextension(choosefiles.java:758)
ted dont get initialized for some reason.
Why?