In this piece of code:
I want to to programmatically set the MediaView instance to MediaView0, MediaView1, MediaView2, etc. where the numeric suffix is equal to the variable a.
I am sure I've seen a solution to this in the Forum, but despite extensive searching, I can't find it and so I'd appreciate any guidance.
Incidentally, I assume there's no problem with each instance having the same event name, but please advise if that's not the case.
B4X:
Private MediaView0, MediaView1, MediaView2, MediaView3, MediaView4, MediaView5, MediaView6, MediaView7, MediaView8, MediaView9, MediaView10, MediaView11 As MediaView
Sub LoadMediaView
For Each k As Object In mapHomeTeam.Keys
Dim playerId As String = mapHomeTeam.Get(k)
For a = 0 To mapHomeTeam.Size - 1
If playerId = arrayHome(a, 0) Then
If File.Exists(PublicApplicationDataFolder & "\Intros\" & cmbOrganisationID.Value, mediaFile & ".mp4") = True Then
MediaView0.Initialize(Me, "mpp")
MediaView0.Source = File.GetUri(PublicApplicationDataFolder & "\Intros\" & cmbOrganisationID.Value, mediaFile)
End If
End If
Next
Next
End Sub
I want to to programmatically set the MediaView instance to MediaView0, MediaView1, MediaView2, etc. where the numeric suffix is equal to the variable a.
I am sure I've seen a solution to this in the Forum, but despite extensive searching, I can't find it and so I'd appreciate any guidance.
Incidentally, I assume there's no problem with each instance having the same event name, but please advise if that's not the case.