File tree 2 files changed +4
-10
lines changed
app/src/main/java/fr/free/nrw/commons/upload
2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 1
1
package fr .free .nrw .commons .upload ;
2
2
3
- import android .content .Context ;
4
3
import android .net .Uri ;
5
4
6
5
import com .android .volley .Cache ;
21
20
import java .util .List ;
22
21
import java .util .Set ;
23
22
23
+ import fr .free .nrw .commons .CommonsApplication ;
24
24
import timber .log .Timber ;
25
25
26
26
/**
@@ -32,15 +32,13 @@ public class MwVolleyApi {
32
32
33
33
private static RequestQueue REQUEST_QUEUE ;
34
34
private static final Gson GSON = new GsonBuilder ().create ();
35
- private Context context ;
36
35
37
36
protected static Set <String > categorySet ;
38
37
private static List <String > categoryList ;
39
38
40
39
private static final String MWURL = "https://commons.wikimedia.org/" ;
41
40
42
- public MwVolleyApi (Context context ) {
43
- this .context = context ;
41
+ public MwVolleyApi () {
44
42
categorySet = new HashSet <>();
45
43
}
46
44
@@ -94,12 +92,8 @@ private String buildUrl (String coords){
94
92
}
95
93
96
94
private synchronized RequestQueue getQueue () {
97
- return getQueue (context );
98
- }
99
-
100
- private static RequestQueue getQueue (Context context ) {
101
95
if (REQUEST_QUEUE == null ) {
102
- REQUEST_QUEUE = Volley .newRequestQueue (context );
96
+ REQUEST_QUEUE = Volley .newRequestQueue (CommonsApplication . getInstance () );
103
97
}
104
98
return REQUEST_QUEUE ;
105
99
}
Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ public void useImageCoords() {
402
402
app .getCacheData ().setQtPoint (decLongitude , decLatitude );
403
403
}
404
404
405
- MwVolleyApi apiCall = new MwVolleyApi (this );
405
+ MwVolleyApi apiCall = new MwVolleyApi ();
406
406
407
407
List <String > displayCatList = app .getCacheData ().findCategory ();
408
408
boolean catListEmpty = displayCatList .isEmpty ();
You can’t perform that action at this time.
0 commit comments