0

遇到以下错误的问题

The method getIntent() is undefined for the type

在使用以下内容时extends SherlockFragment {

代码

public View onCreateView(LayoutInflater inf, ViewGroup grp, Bundle icicle) {

    View v = inf.inflate(R.layout.activity_main, grp, false);
    web = (WebView) v.findViewById(R.id.webView);
    progressBar = (ProgressBar) v.findViewById(R.id.progressBar1);
    Bundle extras = getIntent().getExtras();
    String url;
    url = extras.getString("url");
    setHasOptionsMenu(true);
    return v;
4

2 回答 2

5

尝试使用 getActivity() ===> getActivity().getIntent().getExtras();

   Bundle extras = getActivity().getIntent().getExtras();
于 2013-06-10T05:05:38.820 回答
1

试试你的 OnActivityCreated

捆绑包 = UrFragment.this.getArguments();

于 2013-06-10T05:11:17.517 回答