String profileUUID = MLDB.getOption(MLDB.OPT_PROFILE_UUID, null);
MobileLedgerProfile profile;
- if (Data.profiles.isEmpty()) {
- profile = MobileLedgerProfile.loadAllFromDB(profileUUID);
- }
- else {
- try(LockHolder lh = Data.profiles.lockForReading()) {
- int i = Data.getProfileIndex(profileUUID);
- if (i == -1 ) i = 0;
- profile = Data.profiles.get(i);
- }
- }
+ profile = Data.getProfile(profileUUID);
if (Data.profiles.isEmpty()) {
findViewById(R.id.no_profiles_layout).setVisibility(View.VISIBLE);
}
public void onAccountSummaryRowViewClicked(View view) {
- ViewGroup row = (ViewGroup) view.getParent();
+ ViewGroup row;
+ if ( view.getId() == R.id.account_expander ) row = (ViewGroup) view.getParent().getParent();
+ else row = (ViewGroup) view.getParent();
+
LedgerAccount acc = (LedgerAccount) row.getTag();
switch (view.getId()) {
case R.id.account_row_acc_name:
+ case R.id.account_expander:
case R.id.account_expander_container:
Log.d("accounts", "Account expander clicked");
if (!acc.hasSubAccounts()) return;