diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/asynctasks/GetLatestPostsTask.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/asynctasks/GetLatestPostsTask.java index 3a6f216..b46b121 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/asynctasks/GetLatestPostsTask.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/asynctasks/GetLatestPostsTask.java @@ -22,10 +22,14 @@ public class GetLatestPostsTask extends SafeAsyncTask 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 diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/LatestPostsFragment.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/LatestPostsFragment.java index 67d991b..7183524 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/LatestPostsFragment.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/fragments/LatestPostsFragment.java @@ -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