mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Added check that Fragment is not null
This commit is contained in:
parent
5e500fa653
commit
4f654f3b72
1 changed files with 27 additions and 22 deletions
|
|
@ -133,6 +133,7 @@ public class CategorizationFragment extends SherlockFragment{
|
||||||
|
|
||||||
protected void setCatsAfterAsync(ArrayList<String> categories, String filter) {
|
protected void setCatsAfterAsync(ArrayList<String> categories, String filter) {
|
||||||
|
|
||||||
|
if (getActivity() != null) {
|
||||||
ArrayList<CategoryItem> items = new ArrayList<CategoryItem>();
|
ArrayList<CategoryItem> items = new ArrayList<CategoryItem>();
|
||||||
HashSet<String> existingKeys = new HashSet<String>();
|
HashSet<String> existingKeys = new HashSet<String>();
|
||||||
for (CategoryItem item : categoriesAdapter.getItems()) {
|
for (CategoryItem item : categoriesAdapter.getItems()) {
|
||||||
|
|
@ -163,6 +164,10 @@ public class CategorizationFragment extends SherlockFragment{
|
||||||
categoriesList.smoothScrollToPosition(existingKeys.size());
|
categoriesList.smoothScrollToPosition(existingKeys.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
Log.e(TAG, "Error: Fragment is null");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class CategoriesAdapter extends BaseAdapter {
|
private class CategoriesAdapter extends BaseAdapter {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue