<me.maxwin.view.XListView android:id=
"@+id/xListView" android:layout_width=
"fill_parent" android:layout_height=
"fill_parent" android:cacheColorHint=
"#00000000" >
handler =
new Handler(); arrayAddList(); xListView = (XListView)findViewById(R.id.xListView); xListView.setPullLoadEnable(
true); arrayAdapter =
new ArrayAdapter<String>(
this, R.layout.listview_item,arrayList); xListView.setAdapter(arrayAdapter); xListView.setXListViewListener(
this);
@Override public void onRefresh() { handler.postDelayed(
new Runnable() {
@Override public void run() { arrayList.add(
"XListView刷新==" + (++start)); arrayAdapter.notifyDataSetInvalidated(); onLoad(); } },
2000); }
@Override public void onLoadMore() { handler.postDelayed(
new Runnable() {
@Override public void run() { arrayList.add(
"XListView刷新==" + (++start)); arrayAdapter.notifyDataSetChanged(); onLoad(); } },
2000); }
private void onLoad() { xListView.stopRefresh(); xListView.stopLoadMore(); SimpleDateFormat formatter =
new SimpleDateFormat(
"MM-ddHH:mm:ss"); Date curDate =
new Date(System.currentTimeMillis()); String str = formatter.format(curDate);
转载请注明原文地址: https://ju.6miu.com/read-6160.html