i am setting tablayout to my viewpager . but when i use notifyDataSetChanged then it removing my customview and showing default title view my code
ViewPager viewPager = findView(R.id.view_pager);
ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager(), getResources(), getFragments());
viewPager.setAdapter(adapter);
tabs.setupWithViewPager(viewPager);
for (int i = 0; i < tabs.getTabCount(); i++) {
TabLayout.Tab tab = tabs.getTabAt(i);
tab.setCustomView(getTabView(i));
}
t.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
adapter.notifyDataSetChanged();
}
});
public View getTabView(int position) {
View v = LayoutInflater.from(this).inflate(R.layout.pager_tab, null);
RelativeLayout linearLayout = (RelativeLayout) v.findViewById(R.id.view);
return v;
}
so its working properly but when i call adapter.notifyDataSetChanged(); then my tablayout not showing customview which i have already added prev . it only showing default title .. this same code is working if i use compile "com.android.support:design:23.1.1"
but if i change this to newer version this is not working please can any one help me i trying this but havnt got ans or any other alternative lib or method where i can add customView in tab view