Simplify catList is empty logic

This commit is contained in:
misaochan 2016-01-11 17:02:02 +13:00
parent 9baafdf82b
commit 5d4768e1ee

View file

@ -191,7 +191,7 @@ public class ShareActivity
//convert image Uri to file path //convert image Uri to file path
FilePathConverter uriObj = new FilePathConverter(this, mediaUri); FilePathConverter uriObj = new FilePathConverter(this, mediaUri);
String filePath = uriObj.getFilePath(); String filePath = uriObj.getFilePath();
if (filePath != null) { if (filePath != null) {
//extract the coordinates of image in decimal degrees //extract the coordinates of image in decimal degrees
@ -206,11 +206,11 @@ public class ShareActivity
app.cacheData.setQtPoint(decLongitude, decLatitude); app.cacheData.setQtPoint(decLongitude, decLatitude);
MwVolleyApi apiCall = new MwVolleyApi(this); MwVolleyApi apiCall = new MwVolleyApi(this);
List displayCatList = app.cacheData.findCategory(); List displayCatList = app.cacheData.findCategory();
boolean catListEmpty = displayCatList.isEmpty();
//if no categories found in cache, call MW API to match image coords with nearby Commons categories //if no categories found in cache, call MW API to match image coords with nearby Commons categories
if (displayCatList.size() == 0) { if (catListEmpty) {
cacheFound = false; cacheFound = false;
apiCall.request(decimalCoords); apiCall.request(decimalCoords);
Log.d(TAG, "displayCatList size 0, calling MWAPI" + displayCatList.toString()); Log.d(TAG, "displayCatList size 0, calling MWAPI" + displayCatList.toString());