- if (arg == null) mProfileListAdapter.notifyDataSetChanged();
- else mProfileListAdapter.notifyItemChanged((int) arg);
-
- createShortcuts();
- }
- private void onProfileChanged(Object arg) {
- MobileLedgerProfile profile = Data.profile.get();
- MainActivity.this.runOnUiThread(() -> {
-
- boolean haveProfile = profile != null;
- findViewById(R.id.no_profiles_layout)
- .setVisibility(haveProfile ? View.GONE : View.VISIBLE);
- findViewById(R.id.pager_layout)
- .setVisibility(haveProfile ? View.VISIBLE : View.VISIBLE);
-
- if (profile == null) MainActivity.this.setTitle(R.string.app_name);
- else MainActivity.this.setTitle(profile.getName());
- MainActivity.this.updateLastUpdateTextFromDB();
- int old_index = -1;
- int new_index = -1;
- if (arg != null) {
- MobileLedgerProfile old = (MobileLedgerProfile) arg;
- old_index = Data.getProfileIndex(old);
- new_index = Data.getProfileIndex(profile);
- }