@Override public void loadData() { if (HttpConnectUtil.isNetworkAvailable(this)) { if (noticeTask != null) { noticeTask.cancel(true); } if (messageTask != null) { messageTask.cancel(true); } if (selectedIndex == SYSTEM_NOTICE) { noticeTask = new NoticeListTask(); noticeTask.execute(); } else if (selectedIndex == USER_MESSAGE) { if (appState.getUsername() != null) { messageTask = new GetMessageTask(); messageTask.execute(); } else { toLogin = true; ActionUtil.toLogin(this, null); } } } else { viewRefreshNotice.onHeaderRefreshComplete(); viewRefreshMessage.onHeaderRefreshComplete(); showNetWorkErrorPage(); } }
private void setupNoticeViews() { LayoutInflater inflater = getLayoutInflater(); View viewNotice = inflater.inflate(R.layout.include_new_viewpager_listview, null); noticeListView = (AutoLoadListView) viewNotice.findViewById(R.id.listview); noticeListView.setOnLoadDataListener(this); layoutEmptyNotice = (EmptyLayout) viewNotice.findViewById(R.id.empty_layout); layoutEmptyNotice.setOnGetDataAgainListener(this); viewRefreshNotice = (RefreshLayout) viewNotice.findViewById(R.id.pull_refresh_view); viewRefreshNotice.setOnHeaderRefreshListener(this); viewList.add(viewNotice); }
private void setupMessageViews() { LayoutInflater inflater = getLayoutInflater(); View viewMessage = inflater.inflate(R.layout.include_new_viewpager_expandable_listview, null); messageListView = (AutoLoadExpandableListView) viewMessage.findViewById(R.id.expandable_listview); messageListView.setOnLoadDataListener(this); layoutEmptyMessage = (EmptyLayout) viewMessage.findViewById(R.id.empty_layout); layoutEmptyMessage.setOnGetDataAgainListener(this); viewRefreshMessage = (RefreshLayout) viewMessage.findViewById(R.id.pull_refresh_view); viewRefreshMessage.setOnHeaderRefreshListener(this); viewList.add(viewMessage); }
@Override protected void onResume() { super.onResume(); if (toLogin) { toLogin = false; if (((LotteryApp) getApplication()).getUsername() != null) { selectedIndex = USER_MESSAGE; if (titleData.size() != 0) { viewRefreshMessage.headerRefreshing(); } onRefresh(); } else { topMenuLayout.check(SYSTEM_NOTICE); } } }