@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 HashMap<String, String> initHashMap() { String phone = appState.getUsername(); HashMap<String, String> parameter = new HashMap<String, String>(); parameter.put("service", "get_user_notice"); parameter.put("pid", LotteryUtils.getPid(MessageCenter.this)); parameter.put("phone", HttpConnectUtil.encodeParameter(phone)); parameter.put("page_no", "" + pageMessage); parameter.put("size", "10"); parameter.put("query_type", "1"); return parameter; }
public void showDialog() { if (HttpConnectUtil.isNetworkAvailable(WapBankRecharge.this)) { text_first_dlg.setText(appState.getUsername()); text_second_dlg.setText(type); text_third_dlg.setText(rechargeMoney + "元"); customDialog_re.setContentView( eventview, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); customDialog_re.show(); } else { ViewUtil.showTipsToast(this, noNetTips); } }