I have a ViewPager with 3 tabs. If a tab is selected I want the listview in that tab to scroll up after I tap the same tab in ViewPager.
Right now I have a ViewPager.OnPageChangeListener
and it only fires when I select another tab and it doesnt do anything when I tap the selected tab.
What function should I override?
Asked
Active
Viewed 297 times
1

abeikverdi
- 1,216
- 3
- 13
- 25
-
so you wanna listview in your tab ? – Dec 04 '15 at 07:24
-
I have a listview, I just wanna know how to trigger a click on a selected tab in ViewPager. – abeikverdi Dec 04 '15 at 07:25
-
http://stackoverflow.com/questions/23970301/what-event-is-triggered-when-a-tab-fragment-is-selected – Dec 04 '15 at 07:26
-
It doesnt work for me. When I change the tab and go back to the tab, it triggers that setUserVisibleHint, but if I click the selected tab, nothing happens. – abeikverdi Dec 04 '15 at 07:37
-
I am looking for something like facebook's tabs. when you press a selected tab, it scrolls up the listview/recycleview. I am not sure what function is triggered once user presses a tab button that's selected. – abeikverdi Dec 04 '15 at 07:40
-
Can you show click handler for the tabs? It should be in there. – Sebastian Roth Dec 04 '15 at 07:50
-
I should add a specific click handler for that? Doesnt viewpager have a built in click handler? – abeikverdi Dec 04 '15 at 08:26