@Override protected void onDialogClosed(boolean positiveResult) { super.onDialogClosed(positiveResult); Log.d( TAG, "positiveResult = " + positiveResult + " mIndex = " + mIndex + " mClickedDialogEntryIndex = " + mClickedDialogEntryIndex); // / M: Dialog dismiss is asynchronous, so hot-swap may reset the // mEntryValues if (positiveResult && mIndex != mClickedDialogEntryIndex && mEntryValues.size() > mClickedDialogEntryIndex) { // get the selected values --- simId long simId = mEntryValues.get(mClickedDialogEntryIndex); // pass simId to onPreferenceChangeListener if (callChangeListener(simId)) { mIndex = mClickedDialogEntryIndex; mAdapter.notifyDataSetChanged(); } } }
private CharSequence getPrefSummary(int index) { String summary = null; Object item = mAdapter.getItem(index); if (item instanceof SubInfoRecord) { SubInfoRecord simItem = (SubInfoRecord) item; summary = simItem.displayName; } else if (item instanceof AccountElements) { summary = ((AccountElements) item).getName(); } return summary; }
public void updateSubStatus(long subId, Boolean status) { int listIndex = 0; for (SubInfoRecord item : mSubItems) { if (item.subId == subId) { if (mItemStatus.size() != 0) { mItemStatus.set(listIndex, status); mAdapter.notifyDataSetChanged(); } } listIndex++; } }
/** * Sets the index of given value * * @param value one values of the entries */ public void setValue(long value) { mIndex = findIndexOfValue(value); if (mIndex >= 0) { setSummary(getPrefSummary(mIndex)); } else { // / M: if can not find the Index Value, means the subcard has all // plug out, // just reset the summary to null. @{ setSummary(null); } mAdapter.notifyDataSetChanged(); // @} }
public void setEnableNormalItem(boolean isEnabled) { mEnableNormalItem = isEnabled; mAdapter.notifyDataSetChanged(); }
public int getItemCount() { return mAdapter.getCount(); }
public void updateSubInfoList(List<SubInfoRecord> simValues) { mSubItems = simValues; mAdapter.notifyDataSetChanged(); }