Addtobackstack is not working properly in android

80 views Asked by At

When I am adding HomeFragment in addtoBackStack and visit another fragment SecondFragment then,came back again on HomeFragment then layout not able to restore its data.This is what i have done in below code,inflate the layout once.So that when i came back layout does not inflate again

    Please help me

.

MainActivity.java

 @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        if (rootView == null) {
            rootView = inflater.inflate(R.layout.main_display, container,
                    false);
        } else {
        }
0

There are 0 answers