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<
try
private View myFragmentView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { myFragmentView = inflater.inflate(R.layout.myLayoutId, container, false); myView = myFragmentView.findViewById(R.id.myIdTag) return myFragmentView; }