What is the difference between this assignment of a reference to a fragment
Fragment frag1 = getFragmentManager().findFragmentById(R.id.fragment1); frag1.getView().findViewById(R.id.textView_1)).setText(""); from ( Fragment_1 - class realizing fragment)
Fragment_1 frag1 = new Fragment_1(); frag1.getView().findViewById(R.id.textView_1)).setText(""); As far as I understand, the link is assigned to the same layout file, but only the first option works! Why?