mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2024-11-27 07:49:28 +00:00
Made method call more clear
This commit is contained in:
parent
35c5040133
commit
a29700aea5
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user