出现以下错误问题
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;
答案 0 :(得分:5)
尝试使用getActivity()===> 。getActivity()getIntent()getExtras();
Bundle extras = getActivity().getIntent().getExtras();
答案 1 :(得分:1)
尝试使用OnActivityCreated
Bundle bundle = UrFragment.this.getArguments();