public void storeData() {
    array = pref.getSavedBlockNumber();

    Collections.sort(
        array,
        new Comparator<BlockNumber>() {
          @Override
          public int compare(BlockNumber lhs, BlockNumber rhs) {
            return (lhs.regTime > rhs.regTime) ? -1 : (lhs.regTime < rhs.regTime) ? 1 : 0;
          }
        });

    cbAll.setChecked(false);
    adapter.clear();
    for (int i = 0; i < array.size(); i++) adapter.add(array.get(i));
  }
 @Override
 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
   adapter.setChecked(position);
   adapter.notifyDataSetChanged();
 }
 @Override
 protected void onResume() {
   super.onResume();
   storeData();
   adapter.notifyDataSetChanged();
 }