Ejemplo n.º 1
0
  private void initView() {
    mTitleBar = (TitleBar) findViewById(R.id.title_bar);
    mTitleBar.setTitle("预约服务");

    mListView = (PullToRefreshListView) findViewById(R.id.listview);
    mListView.setMode(Mode.PULL_FROM_END);
    mListView.setOnRefreshListener(
        new OnRefreshListener2<ListView>() {

          @Override
          public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {}

          @Override
          public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
            //				loadData();
            //				mListView.onRefreshComplete();
            new GetDataTask().execute();
          }
        });

    //		mListView.setOnItemClickListener(new OnItemClickListener() {
    //
    //			@Override
    //			public void onItemClick(AdapterView<?> parent, View view,
    //					int position, long id) {
    //				startActivity(new Intent(ReserveServiceActivity.this, CommitReserveMsgActivity.class));
    //			}
    //		});

    mListView.setAdapter(mAdapter);
  }
Ejemplo n.º 2
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    Log.d("zhiheng", "init listview and setAdater");
    mListView = (PullToRefreshListView) fragmentView.findViewById(R.id.refresh_listview);
    mListView.setAdapter(mAdapter);

    setListener();
  }