How to pass click event from custom action bar to current page of android ViewPager? -
i have activity
android.support.v4.view.viewpager
, custom actionbar
. there three(0,1,2) pages in viewpager
page 1 set default page , user can slide left , right. 1 fragment class used show ui each of pages,which has webview
shows html data can collapsed , viewed on button
click in webview
. there button in action, , i'm required collapse , show these data on webview
on click of button
in actionbar
. i've done problem items on viewing page of viewpager
not toggling on click of button in actionbar, while page on left or right of working well. how can solve problem? correct method of doing this?
- you need write 3 interfaces in 3 fragments.
- you need register 3 fragments pager adapter/activity.
- whenever click on actionbar button check active/current page in viewpager.
- perform click operation on registered interface on basis of active/current page/fragment.
Comments
Post a Comment