Sub MenuAB_Click(ActionBar As ClsActionBar, Btn As View)
'Now search the ID of the item clicked
Dim tmpTag, tmpString As String
tmpTag = Btn.Tag
If tmpTag.Contains("OnLongClickSub") Then
#If Debug
Log("Btn.Tag: " & Btn.Tag)
#End If
tmpString = tmpTag.Replace("OnLongClickSub","#")
#If Debug
Log("tmpString1: " & tmpString)
#End If
tmpString = tmpString.SubString(tmpString.IndexOf("#")+2)
tmpString = tmpString.SubString2(0,tmpString.IndexOf(","))
#If Debug
Log("tmpString2: " & tmpString)
Log("End of tmpString: " & Asc(tmpString.CharAt(tmpString.Length-1))) 'Here there is a chr10 (LF) at end
#End If
tmpString = tmpString.Replace("_LongClick","")
#If Debug
Log("tmpString2: " & tmpString)
Log("End of tmpString: " & Asc(tmpString.CharAt(tmpString.Length-1))) 'Here the same chr10 at end also, any test you do with the variable tmpString after don't work.
' See the log attached
' I don't know if it's due to SubString2 or Replace but with Android 4.x i haven't this problem before.
#End If
tmpString = tmpString.Trim ' <- ' I have add this and that's work now
#If Debug
Log("End of tmpString: " & Asc(tmpString.CharAt(tmpString.Length-1))) 'Here nothing more than the SubString who is needed.
Log("Sender: " & tmpString)
#End If
End If
.../....
End Sub