コード例 #1
0
  private void initView() {
    mHandler = new Handler();

    mListView = (XListView) findViewById(R.id.list_view);
    mListView.setPullRefreshEnable(true);
    mListView.setPullLoadEnable(true);
    mListView.setXListViewListener(this);
    mListView.setRefreshTime(getTime());

    mAdapter = new ArrayAdapter<String>(this, R.layout.vw_list_item, items);
    mListView.setAdapter(mAdapter);
    mListView.setOnItemClickListener(
        new OnItemClickListener() {

          @Override
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Toast.makeText(getApplicationContext(), "" + position, 1).show();
          }
        });
  }
コード例 #2
0
 private void onLoad() {
   mListView.stopRefresh();
   mListView.stopLoadMore();
   mListView.setRefreshTime(getTime());
 }