예제 #1
0
 /** 获取消息数据 */
 private void postLoad() {
   asyncHttpClient = new AsyncHttpClient();
   asyncHttpClient.addHeader("Cookie", getContext().getLoginUserCookie());
   asyncHttpClient.setUserAgent(Constants.USER_AGENT);
   RequestParams rp = new RequestParams();
   asyncHttpClient.post(getActivity(), Constants.queryMessageAPI, rp, responseHandler);
 }
예제 #2
0
 @Override
 public void onDestroy() {
   super.onDestroy();
   if (asyncHttpClient != null) asyncHttpClient.cancelRequests(getActivity(), true);
   if (mMessageReceiver != null) getActivity().unregisterReceiver(mMessageReceiver);
 }