我使用的是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