OnCreateView() is used to create a new view and return the corresponding View object. OnCreate() is used to create a new activity and return the corresponding Activity object.
This is an example of how to use onCreateView():
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.activity_main, container);
}
This is an example of how to use onCreate():
public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);