@@ -0,0 +1,1115 @@
+package ca.ualberta.cs.cmput301f14t14.questionapp.data.threading;%0A%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport android.content.Context;%0Aimport android.util.Log;%0Aimport ca.ualberta.cs.cmput301f14t14.questionapp.data.Callback;%0Aimport ca.ualberta.cs.cmput301f14t14.questionapp.data.ESSearch;%0Aimport ca.ualberta.cs.cmput301f14t14.questionapp.data.GenericSearchItem;%0A%0Apublic class ESSearchTask extends AbstractDataManagerTask%3CString, Void, List%3CGenericSearchItem%3E%3E %7B%0A%09private Context context;%0A%09public ESSearchTask(Context c) %7B%0A%09%09super(c);%0A%09%09context = c;%0A%09%7D%0A%0A%09@Override%0A%09protected List%3CGenericSearchItem%3E doInBackground(String... arg0) %7B%0A%09%09%0A%09%09String query = arg0%5B0%5D;%0A%09%09List%3CGenericSearchItem%3E gSIList = null;%0A%09%09ESSearch es = new ESSearch(context);%0A%09%09try%7B%0A%09%09%09gSIList = es.search(query);%0A%09%09%7Dcatch(IOException e)%7B%0A%09%09%09Log.e(%22ESSearch%22, %22Failed to get search results%22);%0A%09%09%09gSIList = new ArrayList%3CGenericSearchItem%3E();%0A%09%09%7D%0A%09%09return gSIList;%0A%09%7D%0A%09%0A%09@Override%0A%09protected void onPostExecute(List%3CGenericSearchItem%3E la) %7B%0A%09%09if (callback == null)%7B%0A%09%09%09return;%0A%09%09%7D%0A%09%09callback.run(la);%0A%09%7D%0A%0A%7D%0A

add new ESSearchTask