我使用的是Android 1.6的64位Windows 7 下,当我打电话notifyDataSetChanged()从延伸BaseAdapter我得到了运行时异常notifyDataSetChanged();来源未发现异常
我试图使用Eclipse调试器,并计算出该适配器对象主要活动试图调用这个方法ZygoteInit $ MethodAndArgsCaller.run()行: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);
}
});
}
}
你可以添加你的日志..? – 2011-04-19 07:40:31