Q: Load class when using onCreateView within another class - Java I have the below code which is loading the view 'feed1' into the pager from within the main class. What I want is to be able to attach some code to 'feed1'...so when the view switches to this, the code will run on populate a listview.
Something like:
//Set the rootView xml page.
//Now set the rootView class page.
Any advice will be helpful!
public static class DummySectionFragment extends Fragment {

        public static final String ARG_SECTION_NUMBER = "section_number";

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {


              View rootView = inflater.inflate(R.layout.feed1, container, false);
              Bundle args = getArguments();               
              return rootView;
        }
    }


A: When you send to background your app, you can lose some variables.Here's onPause(), onResume() Check Activity Lifecycle and Fragment Lifecycle, and how to save and get your variables , i hope help you. 
