Android Question TabStrip access Events?

ilan

Expert
Licensed User
Hi

I see that the Tabstrip has 2 more events beside the PageSelected event that is available in b4a.

onPageScrollStateChanged
onPageScrolled

Is there any way to access them?

Thank you, ilan
 

Erel

Administrator
Staff member
Licensed User
B4X:
Dim jo As JavaObject = TabStrip1
Dim event As Object = jo.CreateEventFromUI("android.support.v4.view.ViewPager.OnPageChangeListener", "PageChangeListener", Null)
jo.GetFieldJO("tabStrip").RunMethod("setOnPageChangeListener", Array(event))
End Sub

Sub PageChangeListener_Event (MethodName As String, Args() As Object) As Object
   Log("Method: " & MethodName)
   Dim ArgsList As List = Args
   Log("Args: " & ArgsList)
   Return Null
End Sub
Note that the PageSelected event will not be raised. PageChangeListener_Event will be raised instead with method = "onPageSelected"
 

ilan

Expert
Licensed User
Thank you very much erel. I will try it out. :)

EDIT: Awesome !!! exactly what i needed!! thank you
 
Last edited:
Top