If you want to get the id in the fragment use the following method.
replace the return statement with view like this.
View view= inflater.inflate(R.layout.fragment_left, container, false);
img=view.findViewById(R.id.image);
return view;
call all the methods before you return the view.