|
|
@ -158,19 +158,24 @@ public class ForumFragment extends BaseFragment { |
|
|
|
@Override |
|
|
|
public void onDestroy() { |
|
|
|
super.onDestroy(); |
|
|
|
if (forumTask != null && forumTask.getStatus() != AsyncTask.Status.RUNNING) |
|
|
|
forumTask.cancel(true); |
|
|
|
if (forumTask!=null){ |
|
|
|
try{ |
|
|
|
if(forumTask.isRunning()) |
|
|
|
forumTask.cancel(true); |
|
|
|
} // Yes, it happens even though we checked
|
|
|
|
catch (NullPointerException ignored){ } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public interface ForumFragmentInteractionListener extends FragmentInteractionListener { |
|
|
|
void onForumFragmentInteraction(Board board); |
|
|
|
} |
|
|
|
|
|
|
|
public void onForumTaskStarted() { |
|
|
|
private void onForumTaskStarted() { |
|
|
|
progressBar.setVisibility(ProgressBar.VISIBLE); |
|
|
|
} |
|
|
|
|
|
|
|
public void onForumTaskFinished(int resultCode, ArrayList<Category> fetchedCategories) { |
|
|
|
private void onForumTaskFinished(int resultCode, ArrayList<Category> fetchedCategories) { |
|
|
|
if (resultCode == NetworkResultCodes.SUCCESSFUL) { |
|
|
|
categories.clear(); |
|
|
|
categories.addAll(fetchedCategories); |
|
|
@ -191,8 +196,8 @@ public class ForumFragment extends BaseFragment { |
|
|
|
private class ForumTask extends NewParseTask<ArrayList<Category>> { |
|
|
|
private HttpUrl forumUrl = SessionManager.forumUrl; //may change upon collapse/expand
|
|
|
|
|
|
|
|
public ForumTask(OnTaskStartedListener onTaskStartedListener, |
|
|
|
OnNetworkTaskFinishedListener<ArrayList<Category>> onParseTaskFinishedListener) { |
|
|
|
ForumTask(OnTaskStartedListener onTaskStartedListener, |
|
|
|
OnNetworkTaskFinishedListener<ArrayList<Category>> onParseTaskFinishedListener) { |
|
|
|
super(onTaskStartedListener, onParseTaskFinishedListener); |
|
|
|
} |
|
|
|
|
|
|
|