You can setSupportActionbar like this in fragments:
((AppCompatActivity)getActivity()).setSupportActionBar(mToolbar);
You need to inflate tabbar_layout
in onCreateView
of Fragment
.
Like this:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.tabbar_layout, container, false);
//YOUR STUFF
return rootView;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…