I am trying to use add a list view in ne of the tab in tabbed template in android studio. For that I am also using fragment(list) template. But I am not able to connect these two.
On creating fragment(list) template. I got the below files.
MyItemRecyclerViewAdapter.java
,
ItemFragment.java
,
fragment_item.xml
,
fragment_itemm_list.xml
I updated the oncreateView for tabbing as below.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
if (getArguments().getInt(ARG_SECTION_NUMBER) == 3) {
View rootView = inflater.inflate(R.layout.fragment_item, container, false);
return rootView;
}
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
TextView textView = (TextView) rootView.findViewById(R.id.section_label);
textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER)));
return rootView;
}
But I am not getting anything i.e getting empty page on the third tab.