I am using view pager and in that I am having three fragments. In my second fragment I am having button clicking on which take you to the first fragment.
I am new with the fragment. So please give me your valuable suggestions and links for this.
Thanking you in advance.
On click of the button in the second fragment, communicate from your fragment to your parent activity that the first fragment is to be shown. You parent activity can then call a function in your view pager which shows the first fragment.
Define an interface in the fragment –
In onAttach(), link the callback –
When the back button is clicked, call the callback interface method –
In your view pager, implement the onBackSelectedListener interface.