Add constructor to ExistingFileAsync and call it in ShareActivity

This commit is contained in:
misaochan 2016-12-14 16:25:29 +13:00
parent 9afb1da6fa
commit ce3abcd727
2 changed files with 8 additions and 3 deletions

View file

@ -19,11 +19,11 @@ public class ExistingFileAsync extends AsyncTask<Void, Void, ArrayList<String>>
private final static int SEARCH_CATS_LIMIT = 25;
private static final String TAG = fr.free.nrw.commons.upload.ExistingFileAsync.class.getName();
private String title;
private String fileSHA1;
public ExistingFileAsync(String title) {
public ExistingFileAsync(String fileSHA1) {
super();
this.title = title;
this.fileSHA1 = fileSHA1;
}
@Override

View file

@ -250,6 +250,11 @@ public class ShareActivity
//FIXME: Replace hardcoded string with call to Commons API instead (use TitleCategories.java as template)
// https://commons.wikimedia.org/w/api.php?action=query&list=allimages&aisha1=801957214aba50cb63bb6eb1b0effa50188900ba
ExistingFileAsync fileAsyncTask = new ExistingFileAsync(fileSHA1);
fileAsyncTask.execute(url1, url2, url3);
String debugSHA1 = "801957214aba50cb63bb6eb1b0effa50188900ba";
boolean fileSHA1Found = fileSHA1.equals(debugSHA1);