Jai*_*oks 0 java android android-intent android-fragments actionbarsherlock
遇到以下错误的问题
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;
Run Code Online (Sandbox Code Playgroud)
尝试使用getActivity()===> getActivity().getIntent().getExtras();
Bundle extras = getActivity().getIntent().getExtras();
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1550 次 |
最近记录: |