Android Question Create a button with a different link in tag

invocker

Active Member
Hi
I want to create a button for simple view To store a link but the problem is the code store the last link in all btn.tag . also there is no btn.name

B4X:
For Each link As String In sources
        p = xui.CreatePanel("")
        p.Color=Colors.Transparent
        x=x+1
        p.SetLayoutAnimated(100,0,0,Root1.Width,Root1.Height)
        p.LoadLayout("MainPage")
        btn.Initialize("btn")
        btn.Tag =link
        'it store the last link in all create button
       
        p.AddView(btn,0,0,50%x,50dip)
        CustomListView1.Add(p,x)
         player1.Initialize("player")
        player1.Prepare(player1.CreateUriSource(link))
        SimpleExoPlayerView1.Player = player1
       
    Next
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…