Made method call more clear

This commit is contained in:
Pierre HUBERT 2018-08-31 19:04:16 +02:00
parent 35c5040133
commit a29700aea5
2 changed files with 7 additions and 3 deletions

View File

@ -22,10 +22,14 @@ public class GetLatestPostsTask extends SafeAsyncTask<Integer, Void, PostsList>
protected PostsList doInBackground(Integer... integers) {
PostsHelper helper = new PostsHelper(getContext());
PostsList list;
//Get the list of posts
int from = integers[0] == 0 ? -1 : integers[0];
PostsList list = helper.get_latest(from);
if(integers.length == 0)
list = helper.get_latest();
else
list = helper.get_latest(integers[0]);
if(list == null) return null;
//Load related information

View File

@ -78,7 +78,7 @@ public class LatestPostsFragment extends AbstractPostsListFragment {
onGotNewPosts(posts);
}
});
mGetLatestPostsTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, 0);
mGetLatestPostsTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
@Override