From 946e2ee7d7fe2f15547c96f13dde85b36e6eced0 Mon Sep 17 00:00:00 2001 From: Abhilash G Date: Tue, 21 Mar 2017 18:16:00 +0530 Subject: [PATCH] fix: The progress bar in Datatables of both Clients and Groups loads endlessly. --- .../mifos/mifosxdroid/online/datatable/DataTableFragment.java | 2 +- .../mifos/mifosxdroid/online/datatable/DataTablePresenter.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/datatable/DataTableFragment.java b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/datatable/DataTableFragment.java index 220b5ca203a..e5fdf15485e 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/datatable/DataTableFragment.java +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/datatable/DataTableFragment.java @@ -99,7 +99,6 @@ public static DataTableFragment newInstance(String tableName, int entityId) { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - ((MifosBaseActivity) getActivity()).getActivityComponent().inject(this); if (getArguments() != null) { tableName = getArguments().getString(Constants.DATA_TABLE_NAME); entityId = getArguments().getInt(Constants.ENTITY_ID); @@ -110,6 +109,7 @@ public void onCreate(Bundle savedInstanceState) { @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + ((MifosBaseActivity) getActivity()).getActivityComponent().inject(this); rootView = inflater.inflate(R.layout.fragment_datatables, container, false); ButterKnife.bind(this, rootView); dataTablePresenter.attachView(this); diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/datatable/DataTablePresenter.java b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/datatable/DataTablePresenter.java index 990b271c023..90d96005686 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/datatable/DataTablePresenter.java +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/online/datatable/DataTablePresenter.java @@ -26,6 +26,7 @@ public class DataTablePresenter extends BasePresenter { public DataTablePresenter(DataManagerDataTable dataManagerDataTable) { this.dataManagerDataTable = dataManagerDataTable; subscriptions = new CompositeSubscription(); + } @Override @@ -36,7 +37,7 @@ public void attachView(DataTableMvpView mvpView) { @Override public void detachView() { super.detachView(); - subscriptions.unsubscribe(); + subscriptions.clear(); } /**