I am currently having an issue with replacing a certain fragment within ViewPager with another. The fragment id like to replace is my \"Departments\" which has an Imagebutton id
I'm assuming you want the Engineering
fragment to be on a completely new page, because you aren't using it in your ViewPagerAdapter
. If that's the case, create a new Activity
, with your Engineering
fragment in the layout, and launch the Activity
from the engineeringButton
click.
The problem is you are trying to shove your Engineering fragment into the View hierarchy of R.layout.activity_departments
, and there is (hopefully) no ViewPager
in there, hence the error.