/* * 改变list相关的保存的数据 */ private void changeListData() { xlist_task.stopRefresh(); xlist_task.stopLoadMore(); xlist_task.setRefreshTime(lastestUpdata); if (currentStatus.size() >= 10) { oldestStatusId = currentStatus.get(currentStatus.size() - 1).getStatusId(); xlist_task.setPullLoadEnable(true); } }
private void initView() { btn_back = (Button) findViewById(R.id.btn_back_my_signup_status); btn_back.setOnClickListener( new OnClickListener() { public void onClick(View v) { finish(); } }); xlist_task = (XListView) findViewById(R.id.xlist_my_signup_status); xlist_task.setPullLoadEnable(false); if (currentStatus != null) { oldestStatusId = currentStatus.get(currentStatus.size() - 1).getStatusId(); adapter = new TaskAdapter(this, currentStatus); xlist_task.setAdapter(adapter); } xlist_task.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { if (currentStatus.size() >= arg2) { clickPosition = arg2 - 1; /*全局变量传递数据*/ Intent intent = new Intent(MySignUpStatusActivity.this, TaskDetailActivity.class); TaUpstairsApplication app = (TaUpstairsApplication) getApplication(); app.setStatus(currentStatus.get(arg2 - 1)); startActivityForResult(intent, IntentString.RequestCode.MYRELEASESTATUS_TASKDETAIL); } } }); xlist_task.setXListViewListener( new IXListViewListener() { @Override public void onRefresh() { getStatusFromTask(Task.TA_GETSTATUS_MODE_FIRSTTIME, null); } @Override public void onLoadMore() { getStatusFromTask(Task.TA_GETSTATUS_MODE_LOADMORE, oldestStatusId); } }); }