setContentView(R.layout.activity_new_transaction);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
- toolbar.setSubtitle(Data.profile.get().getName());
+ toolbar.setSubtitle(mProfile.getName());
tvDate = findViewById(R.id.new_transaction_date);
tvDate.setOnFocusChangeListener((v, hasFocus) -> {
// Log.d("swipe", "hooked to row "+i);
}
}
+ @Override
+ protected void initProfile() {
+ String profileUUID = getIntent().getStringExtra("profile_uuid");
+ if (profileUUID != null) {
+ mProfile = Data.getProfile(profileUUID);
+ if (mProfile == null) finish();
+ }
+ else super.initProfile();
+ }
@Override
public void finish() {
super.finish();
progress.setVisibility(View.VISIBLE);
try {
- saver = new SendTransactionTask(this);
+ saver = new SendTransactionTask(this, mProfile);
String dateString = tvDate.getText().toString();
Date date;
tr.addAccount(item);
}
- if (emptyAmountAccount != null) emptyAmountAccount.setAmount(-emptyAmountAccountBalance);
+ if (emptyAmountAccount != null)
+ emptyAmountAccount.setAmount(-emptyAmountAccountBalance);
saver.execute(tr);
}
catch (ParseException e) {