I'm working on tabactivity's fragment but i'm facing an issue like When i swipe the tab fragment then same UI of tab1 will appear on tab2 i.e.Switch case is not working properly inside placeholder class.While Tab1 and Tab2 having different UI. Please help me i'm new to android.
public View onCreateView(
@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main_tab, container, false);
View root = null;
switch (1) {
case 1:
root = inflater.inflate(R.layout.fragment_main_tab, container, false);
break;
case 2:
root = inflater.inflate(R.layout.fragment_team_screen_, container, false);
break;
}
Next = (ImageButton) rootView.findViewById(R.id.btn_expand);
Next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
updatedetails();
}
});
return rootView;
}