diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java index 12c5b5b..ec6d817 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java @@ -27,6 +27,7 @@ import pl.tpolgrabia.urbanexplorerutils.events.DataLoadingStartEvent; import pl.tpolgrabia.urbanexplorer.utils.HelperUtils; import pl.tpolgrabia.urbanexplorer.views.CustomInterceptor; import pl.tpolgrabia.urbanexplorer.views.SwipeFrameLayout; +import pl.tpolgrabia.urbanexplorerutils.events.RefreshEvent; import pl.tpolgrabia.urbanexplorerutils.utils.LocationUtils; import pl.tpolgrabia.urbanexplorerutils.utils.NetUtils; @@ -179,9 +180,7 @@ public class MainActivity extends ActionBarActivity { return; } - Refreshable refreshable = (Refreshable) fragment; - refreshable.refresh(); - + EventBus.getDefault().post(new RefreshEvent(this)); } public void resetPhotoInfo() { diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/HomeFragment.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/HomeFragment.java index 61dad11..975fa82 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/HomeFragment.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/HomeFragment.java @@ -236,8 +236,6 @@ public class HomeFragment extends Fragment { return; } - MainActivity mainActivity = (MainActivity) getActivity(); - final Location location = LocationUtils.getLastKnownLocation(activity); if (location == null) { lg.info("Location is still not available");