Skip to content

Commit 5827d61

Browse files
committed
Refresh after transactions are exported and deleted.
1 parent a3409d8 commit 5827d61

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

app/src/org/gnucash/android/export/ExporterTask.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ protected void onPostExecute(Boolean exportResult) {
167167

168168
if (mExportParams.shouldDeleteTransactionsAfterExport()){
169169
android.support.v4.app.FragmentManager fragmentManager = ((FragmentActivity)mContext).getSupportFragmentManager();
170-
Fragment currentFragment = fragmentManager
171-
.findFragmentByTag(AccountsActivity.FRAGMENT_ACCOUNTS_LIST);
170+
Fragment currentFragment = ((AccountsActivity)mContext).getCurrentAccountListFragment();
172171

173172
TransactionsDeleteConfirmationDialogFragment alertFragment =
174173
TransactionsDeleteConfirmationDialogFragment.newInstance(R.string.title_confirm_delete, 0);

app/src/org/gnucash/android/ui/account/AccountFormFragment.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,9 @@ public void onDestroy() {
673673
if (mReleaseDbAdapter == true && mAccountsDbAdapter != null) {
674674
mAccountsDbAdapter.close();
675675
}
676+
if (mDefaultTransferAccountCursorAdapter != null) {
677+
mDefaultTransferAccountCursorAdapter.getCursor().close();
678+
}
676679
}
677680

678681
private void saveAccount() {

app/src/org/gnucash/android/ui/account/AccountsActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ public int getCount() {
205205
}
206206
}
207207

208+
public AccountsListFragment getCurrentAccountListFragment(){
209+
int index = mPager.getCurrentItem();
210+
return (AccountsListFragment)(mFragmentPageReferenceMap.get(index));
211+
}
212+
208213

209214
@Override
210215
public void onCreate(Bundle savedInstanceState) {

app/src/org/gnucash/android/ui/transaction/dialog/TransactionsDeleteConfirmationDialogFragment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public void onClick(DialogInterface dialog, int whichButton) {
6262
} else {
6363
adapter.deleteRecord(rowId);
6464
}
65+
adapter.close();
6566
if (getTargetFragment() instanceof AccountsListFragment){
6667
((AccountsListFragment)getTargetFragment()).refresh();
6768
}

0 commit comments

Comments
 (0)