【发布时间】:2011-04-19 07:34:19
【问题描述】:
我在 windows 7 64bit 下使用 android 1.6 当我从扩展 BaseAdapter 的适配器对象调用 notifyDataSetChanged() 时,出现运行时异常
我尝试使用 Eclipse 调试器,发现主活动尝试调用此方法 ZygoteInit$MethodAndArgsCaller.run() line: 842 但调用时出现异常 Source not found。
如果有什么相关的,我会很感激的
and here is the code
public class ViewTaskActivity extends ListActivity
{
private Button addButton;
private TaskManagerApplication app;
private TaskListadapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setUpViews();
app =(TaskManagerApplication)getApplication();
adapter = new TaskListadapter(app.getCurrentTasks(),this);
setListAdapter(adapter);
}
@Override
protected void onResume() {
super.onResume();
adapter.notifyDataSetChanged();;
}
private void setUpViews() {
addButton = (Button)findViewById(R.id.add_button);
addButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(ViewTaskActivity.this , AddTaskActivity2.class);
startActivity(intent);
}
});
}
}
【问题讨论】:
标签: java android google-api