diff --git a/app/src/main/java/org/qinshuihepan/bbs/ui/MyPostsActivity.java b/app/src/main/java/org/qinshuihepan/bbs/ui/MyPostsActivity.java index c764b5a..586de7c 100644 --- a/app/src/main/java/org/qinshuihepan/bbs/ui/MyPostsActivity.java +++ b/app/src/main/java/org/qinshuihepan/bbs/ui/MyPostsActivity.java @@ -139,7 +139,11 @@ protected ArrayList 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); } @@ -152,6 +156,9 @@ protected ArrayList doInBackground(String... params) { @Override protected void onPostExecute(ArrayList posts) { super.onPostExecute(posts); + if(posts.size() == 1) { + posts.clear(); + } myPostsAdapter = new MyPostsAdapter(mContext, posts, mListView); mListView.setAdapter(myPostsAdapter); }