"parent" error on onCreateView


#1

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

@Override
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?


#2

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


#3

Fixed it thanks!