3

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.

4

2 回答 2

3

像这样初始化..

Intent haha = new Intent(getActivity(), Portal.class)
于 2013-10-29T07:23:02.117 回答
0
// try this
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
        Intent haha = new Intent(getActivity(), Portal.class);
}
于 2013-10-29T07:24:08.033 回答