"parent" error on onCreateView


Hey guys I am trying to fix the error that I have on the onCreateView method heres the code because I am going through the Fragments chapter BY THE book

public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_crime, parent, false);
return v;

I have an error red on “parent” why?


Because in the method signature you have “ViewGroup container” instead of “ViewGroup parent”.


Fixed it thanks!