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 で試してください

バンドル bundle = UrFragment.this.getArguments();

于 2013-06-10T05:11:17.517 に答える