I am learning to use ViewPager and PagerTabStrip to implement navigation bar. I have implemented it, my problem is: every time I open the app fresh, the titles don\'t show,
Try this. Its seems to be working for me.
@Override
protected void onResume() {
super.onResume();
pager.setCurrentItem(1);
Task.delay(500).continueWith(new Continuation() {
@Override
public Object then(Task task) throws Exception {
pager.setCurrentItem(0);
return null;
}
}, Task.UI_THREAD_EXECUTOR);
}
onResume set the pager to 1 and then back to 0. This makes the title appear the page loads the first time.