From 87cd8eecab2963b4884bf1f9c53eb21b46a79c0a Mon Sep 17 00:00:00 2001 From: misaochan Date: Wed, 7 Feb 2018 20:13:10 +1000 Subject: [PATCH] Create new ContributionController before NearbyAdapterFactory is initiated --- .../java/fr/free/nrw/commons/nearby/NearbyListFragment.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java index a15f7389f..28377da78 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java @@ -61,6 +61,7 @@ public class NearbyListFragment extends DaggerFragment { View view = inflater.inflate(R.layout.fragment_nearby, container, false); recyclerView = view.findViewById(R.id.listView); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); + controller = new ContributionController(this); adapterFactory = new NearbyAdapterFactory(this, controller); return view; } @@ -70,8 +71,6 @@ public class NearbyListFragment extends DaggerFragment { // Check that this is the first time view is created, // to avoid double list when screen orientation changed List placeList = Collections.emptyList(); - controller = new ContributionController(this); - Bundle bundle = this.getArguments(); if (bundle != null) { String gsonPlaceList = bundle.getString("PlaceList", "[]");