コード例 #1
0
  @Override
  public int doneAsyncTask(int arg1) {
    if (arg1 == GlobalStatic.TASK_SHOUYE_TUIJIAN) { // download the data
      List<BasicInfomation> list =
          GlobeConfData.getInstance()
              .LoadClassifyData(
                  getApplicationContext(), tagClass, 0, GlobalStatic.DOWNLOAD_DATA_COUNT_EACH_TIME);
      if (list.size() == 0) {
        return INIT_FAIL;
      }
      SuperLogs.info("---ff--" + list.size());
      m_notes = new BasicContentAdapter(this, m_Handler, list);
    } else if (arg1 == GlobalStatic.TASK_UPDATE_DATA_SHOUYE) { // pull update the data
      if (m_notes != null) {
        List<BasicInfomation> newlist =
            GlobeConfData.getInstance()
                .LoadClassifyData(
                    getApplicationContext(),
                    tagClass,
                    m_notes.getCount(),
                    m_notes.getCount() + GlobalStatic.DOWNLOAD_DATA_COUNT_EACH_TIME);
        if (newlist.size() == 0) {
          return INIT_FAIL;
        }
        SuperLogs.info("---new--" + newlist.size());
        addAdapterListFirstHeadData(newlist);
      }

    } else if (arg1 == GlobalStatic.TASK_MORE_DATA_SHOUYE) { // More  the data
      int startpositon = 0;
      if (m_notes == null) {
        startpositon = 0;
      } else {
        startpositon = m_notes.getCount();
      }
      List<BasicInfomation> newlist =
          GlobeConfData.getInstance()
              .LoadClassifyData(
                  getApplicationContext(),
                  tagClass,
                  startpositon,
                  startpositon + GlobalStatic.DOWNLOAD_DATA_COUNT_EACH_TIME);
      if (newlist.size() == 0) {
        return INIT_FAIL;
      }
      SuperLogs.info("-----" + newlist.size());
      for (int i = 0; i < 2; i++) {
        SuperLogs.info("---new--title=" + newlist.get(i).title);
      }
      if (m_notes == null) {
        m_notes = new BasicContentAdapter(this, m_Handler, newlist);
        setListAdapter(m_notes);
      } else {
        addAdapterListBottomData(newlist);
      }
    }

    return super.doneAsyncTask(arg1);
  }
コード例 #2
0
  @Override
  public void InitFinish(int taskId, int init_status) {
    if (taskId == GlobalStatic.TASK_UPDATE_DATA_SHOUYE) { // pull update the data
      SuperLogs.info("arg1 InitFinish");
      super.InitFinish(taskId, init_status);
    }

    if (taskId == GlobalStatic.TASK_SHOUYE_TUIJIAN) {
      SuperLogs.info("downlodad InitFinish");
      setListAdapter(m_notes);
    }

    if (taskId == GlobalStatic.TASK_MORE_DATA_SHOUYE) { // More  the data
      if (m_notes != null) {
        m_notes.notifyDataSetChanged();
      }
      super.InitFinish(taskId, init_status);
    }
  }
コード例 #3
0
    @Override
    protected Boolean doInBackground(BasicInfomation... params) {
      // TODO Auto-generated method stub
      try {

        //				String shead= Parser.getContentOfPage(params[0].siteurl);
        mWebView.loadDataWithBaseURL(
            "about:blank", params[0].detail_content + "</body></html>", "text/html", "utf-8", null);
        SuperLogs.info(params[0].detail_content);
        // mWebView.loadUrl(params[0]);
        //				mWebView.loadDataWithBaseURL("http://www.baidu.com",
        //						sbody, null, "gb2312", null);
        // mWebView.canGoBackOrForward(10);
      } catch (RuntimeException e) {
        e.printStackTrace();
      }

      return true;
    }
コード例 #4
0
 @Override
 public void InitStart(int arg1) {
   if (arg1 == GlobalStatic.TASK_UPDATE_DATA_SHOUYE) { // pull update the data
     SuperLogs.info("arg1 start");
   }
 }