【发布时间】:2014-10-06 03:39:25
【问题描述】:
嘿,这是我第一次使用堆栈溢出,我试图在不同的文件中调用一个类(MainActivity 调用 FetchWeatherTask)我收到错误不是封闭类,这是代码抛出错误
@Override
public boolean onOptionsItemSelected (MenuItem item){
int id = item.getItemId();
if (id == R.id.action_refresh) {
ForecastFragment.FetchWeatherTask weatherTask = new ForecastFragment.FetchWeatherTask();
weatherTask.execute();
return true;
}
我打算尝试一些事情,但我被卡住了完整的错误是
'com.alpha.(appName).ForecastFragment' 不是封闭类
编辑:
我试图在不同的文件中调用一个类来获取天气数据
【问题讨论】:
-
您只包含了部分课程,因此很难确定,但在您发布的代码中,您缺少一个结束
}。 -
哪一行给出了错误?