Android Question Capture the text

tariqyounis

Member
Licensed User
Hello All;
I was expecting when I click on lbl to get its text, not the text of last one as in the code bellow.
any advice.

click event:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    Private xui As XUI
End Sub

Sub Globals
    Private ScrollView1 As ScrollView
    Dim lbl As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Layout")
    For i = 0 To 9
        lbl.Initialize("lbl")
        lbl.RemoveView
        lbl.Gravity=Gravity.CENTER_HORIZONTAL
        lbl.Color=Colors.Red
        lbl.Text=i
        ScrollView1.Panel.AddView(lbl,0,0+90*i,100dip,30dip)
    Next
End Sub

Sub lbl_Click
    Log(lbl.Text)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 
Top