I have a CustomListView with panels conataining checkbox , label and images.
On click on image youtube loads video. It works only the first time then when i press back button to return to my app and click again on image immediately it doesn't work - only after nearly 5-10 seconds. I looked at logs seems that app Resumes twice and only after second resumes Youtube works again.
Here is my code for click on image:
MsgBox show correct values , beside it doesn't work just with simple string without loop. What is wrong ?
Thanks
On click on image youtube loads video. It works only the first time then when i press back button to return to my app and click again on image immediately it doesn't work - only after nearly 5-10 seconds. I looked at logs seems that app Resumes twice and only after second resumes Youtube works again.
Here is my code for click on image:
B4X:
Sub imgScroll_Click
Dim index As Int
index = clvScroll.GetItemFromView(Sender)
Dim pnl As Panel
pnl = clvScroll.GetPanel(index)
Dim lbl As Label
lbl = pnl.GetView(1)
Dim img As ImageView
img = pnl.GetView(2)
For i=0 To WidgetService.YouTubeMap.Size-1
If clvScroll.GetValue (index)=WidgetService.YouTubeMap.GetKeyAt(i) Then
Msgbox (clvScroll.GetValue (index),WidgetService.YouTubeMap.GetValueAt(i))
YouTube.Initialize(YouTube.ACTION_VIEW,WidgetService.YouTubeMap.GetValueAt(i))
YouTube.SetComponent("com.google.android.youtube/.WatchActivity")
YouTube.PutExtra("",WidgetService.YouTubeMap.GetValueAt(i))
StartActivity (YouTube)
Exit
End If
Next
End Sub
MsgBox show correct values , beside it doesn't work just with simple string without loop. What is wrong ?
Thanks
Last edited: