android with viewpager When i click on Button in the first fragment I want the app to navigate to another activity -


i have 2 fragments implemented using view pager. in fragment 1 have 2 button , in fragment 2 have list of item.

when click on particular button in first fragment want app navigate activity.

but scenario when click on particular button in first fragment it's click on second fragment list item , open list item detail.

if knows, please suggest me solution. need possible.

thanks

one thing came on top of head this:

  1. store fragments in viewpager.
  2. listen button click events in first fragment.
  3. from first fragment, notify activity of said click event.
  4. your activity (which houses viewpager) should respond click event commanding viewpager move second page (which contains second fragment). can calling yourviewpager.setcurrentitem().

and there have it. fragment contains button move pager onto next page/fragment.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -