@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        Log.e(TAG, "onCreateView: ");

        if (null != rootView) {
            ViewGroup parent = (ViewGroup) rootView.getParent();
            if (null != parent) {
                parent.removeView(rootView);
            }
        } else {
            rootView = inflater.inflate(R.layout.fragment_three, container, false);
            loadData();
        }

        final ImageView imageView = rootView.findViewById(R.id.image);
        rootView.findViewById(R.id.reload).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(a){
                    imageView.setImageResource(R.drawable.a5);
                }else {
                    imageView.setImageResource(R.drawable.cat);
                }
                a=!a;
            }
        });

        return rootView;
    }
Use this factory method to create a new instance of
this fragment using the provided parameters.

@param param1 Parameter 1.
@param param2 Parameter 2.
@return A new instance of fragment ThreeFragment.
app/src/main/java/home/smart/fly/animations/ui/activity/multifragments/ThreeFragment.java