// 解析Timeline接口返回的数据
  private void handlePostExecute(String result, int type) {
    if (!isNetworkConnected(getActivity())) {
      Util.showToast(getActivity(), "没有可用网络,请检查网络设置~");
      listView.onRefreshComplete();
    } else if (result == "") {
      Util.showToast(getActivity(), "网络开小差了,不如再试试吧~");
      listView.onRefreshComplete();
    } else {
      LinkedList<PostBean> postBeans = PostBean.parseBabietaTimeline(result, getActivity());
      if (type == 0) {
        listPostAdapter.clearPost(); // 上拉刷新,清空原来的数据
        listPostAdapter.appendPost(postBeans);
        listPostAdapter.sortPost();

        saveTimeline();
      } else { // 下拉刷新,直接添加数据
        listPostAdapter.appendPost(postBeans);
        listPostAdapter.sortPost();
      }
      listPostAdapter.notifyDataSetInvalidated();
      TextView textView = (TextView) pageView.findViewById(R.id.vp_main_text);
      if (listPostAdapter.getCount() == 0) {
        textView.setText("还没有内容,下拉刷新看看~");
      } else {
        textView.setText("新闻列表");
        textView.setVisibility(View.GONE);
      }
      listView.onRefreshComplete();
    }
  }
  // 从本地缓存读取TimeLine
  private boolean loadTimeline() {
    LinkedList<PostBean> postBeans = new LinkedList<PostBean>();
    String[] collectlist = S.getStringSet(getActivity(), "timeline_list");

    for (int i = 1; i < (collectlist.length); i++) {
      // System.out.println(collectlist[i]);
    }

    for (int i = 1; i < (collectlist.length); ) {
      PostBean postBean = new PostBean();

      try {
        Integer.valueOf(collectlist[i]);
      } catch (Exception e) {
        e.printStackTrace();
        S.put(getActivity(), "timeline_list", "");
        return false;
      }

      postBean.setId(Integer.valueOf(collectlist[i]));
      postBean.setItemURL(collectlist[i + 1]);
      postBean.setTitle(collectlist[i + 2]);
      postBean.setAuthor(collectlist[i + 3]);
      postBean.setUpdatedAt(collectlist[i + 4]);
      postBean.setCreatedAt(collectlist[i + 4]); // (注意这个时间同updated_at)
      postBean.setImageUrl(collectlist[i + 5]);
      postBean.setHeaderImageUrl(collectlist[i + 6]);
      postBean.setDescription(collectlist[i + 7]);
      postBean.setContentType(collectlist[i + 8]);

      postBeans.add(postBean); // 添加到链表
      i = i + 9;
    }

    listPostAdapter.appendPost(postBeans);
    listPostAdapter.sortPost();
    return true;
  }