子Fragment获取父Fragment

在子Fragment操作父Fragment的思路

((FragmentRecyclerBD)FragmentAppointmentBD.this.getParentFragment()).changePageTitle(0,!TextUtils.isEmpty(curSearchContent) ? beanAppointments.size() : 0);//子类


public void changePageTitle(int index,int num){      //父类
if(null != tabLayoutViewPagerAdapter){
switch(index){
case 0:
tabLayoutViewPagerAdapter.setPageTitle(0,(num > 0) ? "预约信息("+num+")" : "预约信息");
break;
case 1:
tabLayoutViewPagerAdapter.setPageTitle(1,(num > 0) ? "收货完成("+num+")" : "收货完成");
break;
default:break;
}//end of switch
}//end of if
}

 

 

posted @ 2017-11-29 17:02  dub  阅读(3898)  评论(0编辑  收藏  举报