Implemented check for null query, other minor changes

This commit is contained in:
misaochan 2015-12-27 14:13:39 +13:00
parent 640ff499c6
commit 7273958b8e
5 changed files with 12 additions and 4 deletions

View file

@ -33,7 +33,7 @@ public class GPSExtractor {
}
if (exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) == null) {
Log.w("Image", "Picture has no GPS info");
Log.d("Image", "Picture has no GPS info");
return null;
}
else {

View file

@ -28,6 +28,7 @@ public class MwVolleyApi {
private static RequestQueue REQUEST_QUEUE;
private static final Gson GSON = new GsonBuilder().create();
private Context context;
private static String coordsLog;
protected static HashSet<String> categorySet;
@ -48,6 +49,7 @@ public class MwVolleyApi {
public void request(String coords) {
coordsLog = coords;
String apiUrl = buildUrl(coords);
Log.d("Image", "URL: " + apiUrl);
@ -162,7 +164,12 @@ public class MwVolleyApi {
}
@Override
public String toString() {
return "query=" + query.toString() + "\n" + printSet();
if (query!=null) {
return "query=" + query.toString() + "\n" + printSet();
}
else {
return "No pages found near " + coordsLog;
}
}
}

View file

@ -181,6 +181,7 @@ public class ShareActivity
if (filePath != null) {
//extract the coordinates of image in decimal degrees
Log.d("Image", "Calling GPSExtractor");
GPSExtractor imageObj = new GPSExtractor(filePath);
String coords = imageObj.getCoords();

View file

@ -140,7 +140,7 @@ public class UploadController {
@Override
protected void onPostExecute(Contribution contribution) {
super.onPostExecute(contribution);
//uploadService.queue(UploadService.ACTION_UPLOAD_FILE, contribution);
uploadService.queue(UploadService.ACTION_UPLOAD_FILE, contribution);
onComplete.onUploadStarted(contribution);
}
});