mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Add subclass for titleCategories
This commit is contained in:
parent
e17c17d0f7
commit
287fd98abb
1 changed files with 13 additions and 1 deletions
|
|
@ -122,6 +122,7 @@ public class CategorizationFragment extends Fragment {
|
||||||
//TODO: Search using MethodA query, but can't use MethodAUpdater because we don't want it updating when user types
|
//TODO: Search using MethodA query, but can't use MethodAUpdater because we don't want it updating when user types
|
||||||
protected ArrayList<String> titleCatQuery() {
|
protected ArrayList<String> titleCatQuery() {
|
||||||
ArrayList<String> items = new ArrayList<String>();
|
ArrayList<String> items = new ArrayList<String>();
|
||||||
|
TitleCategories titleCategoriesSub;
|
||||||
|
|
||||||
//Retrieve the title that was saved when user tapped submit icon
|
//Retrieve the title that was saved when user tapped submit icon
|
||||||
SharedPreferences titleDesc = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
SharedPreferences titleDesc = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||||
|
|
@ -132,7 +133,16 @@ public class CategorizationFragment extends Fragment {
|
||||||
//See http://stackoverflow.com/questions/10972114/how-to-get-a-string-back-from-asynctask
|
//See http://stackoverflow.com/questions/10972114/how-to-get-a-string-back-from-asynctask
|
||||||
TitleCategories asyncTask = new TitleCategories(title);
|
TitleCategories asyncTask = new TitleCategories(title);
|
||||||
try {
|
try {
|
||||||
items = asyncTask.execute().get();
|
titleCategoriesSub = new TitleCategories(title) {
|
||||||
|
@Override
|
||||||
|
protected void onPostExecute(ArrayList<String> result) {
|
||||||
|
super.onPostExecute(result);
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Utils.executeAsyncTask(titleCategoriesSub);
|
||||||
|
|
||||||
|
//items = asyncTask.execute().get();
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
|
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
|
@ -141,6 +151,8 @@ public class CategorizationFragment extends Fragment {
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves recently-used categories
|
* Retrieves recently-used categories
|
||||||
* @return a list containing recent categories
|
* @return a list containing recent categories
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue