mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Fix crash on 2.3 during categorization
This commit is contained in:
parent
1d1e7f9245
commit
8bed027e4e
2 changed files with 14 additions and 1 deletions
|
|
@ -257,7 +257,7 @@ public class CategorizationFragment extends SherlockFragment{
|
|||
lastUpdater.cancel(true);
|
||||
}
|
||||
lastUpdater = new CategoriesUpdater();
|
||||
lastUpdater.executeOnExecutor(executor);
|
||||
Utils.executeAsyncTask(lastUpdater, executor);
|
||||
}
|
||||
|
||||
public void afterTextChanged(Editable editable) {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import javax.xml.transform.*;
|
|||
import java.io.*;
|
||||
import java.text.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
public class Utils {
|
||||
public static Date parseMWDate(String mwDate) {
|
||||
|
|
@ -73,6 +74,18 @@ public class Utils {
|
|||
}
|
||||
}
|
||||
|
||||
static public <T> void executeAsyncTask(AsyncTask<T, ?, ?> task, Executor executor,
|
||||
T... params) {
|
||||
// FIXME: We're simply ignoring the executor on older androids
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
task.executeOnExecutor(executor, params);
|
||||
}
|
||||
else {
|
||||
task.execute(params);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static DisplayImageOptions.Builder defaultImageOptionsBuilder;
|
||||
public static DisplayImageOptions.Builder getGenericDisplayOptions() {
|
||||
if(defaultImageOptionsBuilder == null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue