I am trying to create an ImageView in a Fragment which will refer to the ImageView element which I have created in the XML for the Fragment. However, the findViewById<
findViewById<
There is one more method called onViewCreated.
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); ImageView imageView = (ImageView) view.findViewById(R.id.imageview1); }