如何從片段中清除ArrayList
並執行notifyDataSetChanged()
適配器ListView
?清除ArrayList並在片段的適配器ListView中執行notifyDataSetChanged
這是我的快捷代碼:
public class ConnectionsFragment {
public onClick() {
// do clear data and notify it (from ListView), how?!
}
private class ArrayAdapter extends BaseAdapter {
ArrayList<ConnectionsModel> data;
// constructor saves received data to `data`
// public view `getView()` displays it
}
}
我想要做明確的數據,並通知我在片段級做了onClick()
後(或者,如果是,更容易明確ListView
,直到我讀新數據從API - 所以我想清楚ListView
當我從API讀取)...