@Override public void onRefresh() { if (onRefresh_number) { if (Tools.isConnect(getApplicationContext())) { onRefresh_number = false; buttonClick(); } else { onLoad(); onRefresh_number = true; handler.sendEmptyMessage(2); } } else { handler.sendEmptyMessage(3); } }
@Override public void onLoadMore() { // TODO Auto-generated method stub if (onRefresh_number) { currentPage = currentPage + 1; if (Tools.isConnect(getApplicationContext())) { onRefresh_number = false; getData(); } else { onRefresh_number = true; handler.sendEmptyMessage(2); } } else { handler.sendEmptyMessage(3); } }
@Override public void onLoadMore() { if (onRefresh_number) { currentPage = currentPage + 1; if (Tools.isConnect(getApplicationContext())) { onRefresh_number = false; getOrderList(); } else { currentPage = currentPage - 1; onLoad(); onRefresh_number = true; handler.sendEmptyMessage(2); } } else { handler.sendEmptyMessage(3); } }
@Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_allorder); myApplication = (MyApplication) getApplication(); myApplication.addActivity(this); preferences = getSharedPreferences(Config.SHARED, Context.MODE_PRIVATE); String release = android.os.Build.VERSION.RELEASE; // android系统版本号 version = Integer.parseInt(release.substring(0, 1)); sessionId = preferences.getString("sessionId", "sessionId"); merchantId = preferences.getLong("merchantId", 10000); initView(); setButton(); mAdapter = new TodayOrderAdapter(this, orderList); order_listview.setAdapter(mAdapter); if (Tools.isConnect(getApplicationContext())) { builder = Tools.showLoading(this, "加载中"); getOrderList(); } else { handler.sendEmptyMessage(2); } }