Serg Katrechko
Serg Katrechko

Reputation: 11

invalid method declaration ; return type required

Have errors with this core for some reason please help me understand. I think I missed something. it says invalid method declaration; return type required.

That is AlertFragment

package com.suqareapps.Shopping_Cart;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class AlertFragment extends Fragment {

@Override
public View onCreateView.View(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    // Creating view corresponding to the fragment
    View v = inflater.inflate(R.layout.alert_fragment, container, false);

    return v;
}

}

Upvotes: 1

Views: 84

Answers (1)

Mustafa Çil
Mustafa Çil

Reputation: 776

just override public View onCreateView(LayoutInflater, ViewGroup, Bundle) not public View onCreateView.View. Because there isn't a method like public View onCreateView.View in Fragment class.

Upvotes: 1

Related Questions