I need to use the setSupportActionBar in fragment which I am unable to also I am unable to use setContentView please to help with it also Thankyou in advance the related cod
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;
}