Skip to content

Commit

Permalink
fix small bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fenjuly committed Oct 1, 2014
1 parent 830c057 commit 25485ae
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ protected ArrayList<BasePost> doInBackground(String... params) {
title = a.text();
}
Elements xg1s = bm_c.getElementsByClass("xg1");
comment_count = xg1s.text().substring("回".length());
if(xg1s.text().length() != 0) {
comment_count = xg1s.text().substring("回".length());
} else {
comment_count = "0";
}
post = new Post(0, tid, 0, title, "", time, haveimg, Integer.valueOf(comment_count), author, null);
posts.add(post);
}
Expand All @@ -152,6 +156,9 @@ protected ArrayList<BasePost> doInBackground(String... params) {
@Override
protected void onPostExecute(ArrayList<BasePost> posts) {
super.onPostExecute(posts);
if(posts.size() == 1) {
posts.clear();
}
myPostsAdapter = new MyPostsAdapter(mContext, posts, mListView);
mListView.setAdapter(myPostsAdapter);
}
Expand Down

0 comments on commit 25485ae

Please sign in to comment.