@Override public void onRefresh() { // if( BuildConfig.DEBUG ){ // Track refreshing event ExRatesApplication.getInstance().trackEvent("Rates", "Forced Refresh"); UpdateService.forceUpdate(getActivity()); // } else { // mQuotesRefresher.setRefreshing(false); // Toast.makeText(getActivity(), R.string.force_update_na, Toast.LENGTH_SHORT).show(); // } }
@Override public void onResume() { super.onResume(); // Tracking the screen view ExRatesApplication.getInstance().trackScreenView("Rates Fragment"); populateRatesListView(); ((MainActivity) getActivity()).appBarLayout.addOnOffsetChangedListener(this); final IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(ExRatesApplication.ACTION_STOCKS_UPDATE); intentFilter.addAction(ExRatesApplication.ERROR_NO_CONNECTION); getActivity().registerReceiver(mBroadcastReceiver, intentFilter); }