The Green Foxx The Green Foxx - 4 months ago 33
Android Question

How to initialize an Intent in a fragment class

Im trying to put up this code in my fragment class :

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
Intent haha = new Intent(ProfileFragment.this, Portal.class);

but it just keep saying that "the constructor Intent(ProfileFragment, Class) is Undefined".
i am pretty sure that i have this Class Portal in my java classes.


Initialize ike this..

Intent haha = new Intent(getActivity(), Portal.class)