Commit 7953a4dc authored by Sajal Narang's avatar Sajal Narang Committed by GitHub

Merge pull request #245 from wncc/issue232

Fix data not showing on popping back stack
parents 292e7c74 fbf54a60
......@@ -145,7 +145,6 @@ public class MapFragment extends Fragment implements TextWatcher,
private boolean editTextFocused = false;
private Toast toast;
private String message = "Sorry, no such place in our data.";
private boolean locationsShown = false;
private boolean GPSIsSetup = false;
private boolean followingUser = false;
private Marker user = new Marker("You", "", 0, 0, -10, "");
......@@ -233,10 +232,7 @@ public class MapFragment extends Fragment implements TextWatcher,
@Override
public void onResponse(Call<List<Venue>> call, Response<List<Venue>> response) {
if (response.isSuccessful()) {
if (!locationsShown) {
setupWithData(response.body());
locationsShown = true;
}
setupWithData(response.body());
}
}
......
......@@ -87,7 +87,7 @@ public abstract class RecyclerViewFragment<T extends Clickable, S extends Recycl
/* Skip if we're already destroyed */
if (getActivity() == null || getView() == null) return;
if (adapter == null) {
if (adapter == null || recyclerView.getAdapter() != adapter) {
initAdapter(result);
} else {
adapter.setPosts(result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment