android - ViewPager fragment is not working in 2nd time inside navigation drawer fragment properly -


i have navigation drawer in there 1 fragment tab viewer. in tabviewer, using viewpager in fragment. code viewpager

    viewpager = (viewpager) rootview.findviewbyid(r.id.pager);     viewpager.setadapter(new tabspageradapter(((fragmentactivity)getactivity()).getsupportfragmentmanager()));      pagerslidingtabstrip tabsstrip = (pagerslidingtabstrip) rootview.findviewbyid(r.id.tabs);     tabsstrip.setviewpager(viewpager); 

the tabs coming in first click in navigation drawer content second time title of tabs coming without layout. layout not coming , swipe not working between different tabs? why working first time not rest? attaching images 2 different click on same navigation drawer fragment. first click layout coming perfectly. enter image description here

this in 2nd attempt click on same fragment background coming without layout content.

enter image description here

help rid of problem.

use

getchildfragmentmanager() 

instead of

((fragmentactivity)getactivity()).getsupportfragmentmanager() 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -