String.format("[fragment] removing profile %s", mProfile.getUuid()));
mProfile.removeFromDB();
ArrayList<MobileLedgerProfile> oldList = Data.profiles.getValue();
- assert oldList != null;
+ if (oldList == null) throw new AssertionError();
ArrayList<MobileLedgerProfile> newList =
(ArrayList<MobileLedgerProfile>) oldList.clone();
newList.remove(mProfile);
int index = Data.getProfileIndex(mProfile);
MobileLedgerProfile newProfile = new MobileLedgerProfile(mProfile);
final ArrayList<MobileLedgerProfile> profiles = Data.profiles.getValue();
- assert profiles != null;
+ if (profiles == null) throw new AssertionError();
profiles.set(index, newProfile);
+
+ ProfilesRecyclerViewAdapter prva = ProfilesRecyclerViewAdapter.getInstance();
+ if (prva != null) prva.notifyItemChanged(index);
+
if (mProfile.equals(Data.profile.getValue())) Data.profile.setValue(newProfile);
}
@Override
updateProfileFromUI();
mProfile.storeInDB();
final ArrayList<MobileLedgerProfile> profiles = Data.profiles.getValue();
- assert profiles != null;
+ if (profiles == null) throw new AssertionError();
ArrayList<MobileLedgerProfile> newList =
(ArrayList<MobileLedgerProfile>) profiles.clone();
newList.add(mProfile);