Code example for Fragment

Methods: getActivity

1
 
public class DefaultGameExtrasFragment extends Fragment {
 
    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        TextView tv = new TextView(this.getActivity());
        tv.setText("Implement me!");
        return tv;
    } 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java