mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Implemented check for null query, other minor changes
This commit is contained in:
parent
640ff499c6
commit
7273958b8e
5 changed files with 12 additions and 4 deletions
|
|
@ -114,7 +114,7 @@ public class CategorizationFragment extends SherlockFragment{
|
|||
items.add(new CategoryItem(category, false));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
categoriesAdapter.setItems(items);
|
||||
categoriesAdapter.notifyDataSetInvalidated();
|
||||
categoriesSearchInProgress.setVisibility(View.GONE);
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue