Beispiel #1
0
 @Override
 protected void onPostExecute(Object result) {
   super.onPostExecute(result);
   if (res != null) {
     if ("00".equals(res.getResponseStatus().getCode())) {
       // Success
       if (res != null && res.getProjects() != null && res.getProjects().size() > 0) {
         if (lvContent.getAdapter() == null) {
           adapter = new MyFreeAdapter(lstInvestments);
           lvContent.setAdapter(adapter);
         } else {
           adapter.setLstMyFree(lstInvestments);
         }
         Utils.setListItemCheck(lvContent, lineCount - 1);
       }
     } else {
       // 服务器异常
       Toast.makeText(
               FinanceStocksApp.getContext(),
               res.getResponseStatus().getMessage(),
               Toast.LENGTH_SHORT)
           .show();
     }
   } else {
     Toast.makeText(
             FinanceStocksApp.getContext(), R.string.network_exception, Toast.LENGTH_SHORT)
         .show();
   }
   mRefreshListView.onRefreshComplete();
 }
Beispiel #2
0
 @Override
 protected void onPostExecute(Object result) {
   super.onPostExecute(result);
   if (res != null) {
     if (AppConstants.RESPONSE_SUCCESS.equals(res.getResponseStatus().getCode())) {
       // Success
       if (lvContent.getAdapter() == null) {
         adapter = new MyFreeAdapter(lstInvestments);
         lvContent.setAdapter(adapter);
       } else {
         adapter.setLstMyFree(lstInvestments);
       }
     } else if (!AppConstants.ERROR_TOKEN.equals(res.getResponseStatus().getCode())) {
       // 服务器异常
       Toast.makeText(
               FinanceStocksApp.getContext(),
               res.getResponseStatus().getMessage(),
               Toast.LENGTH_SHORT)
           .show();
     }
   } else {
     Toast.makeText(
             FinanceStocksApp.getContext(), R.string.network_exception, Toast.LENGTH_SHORT)
         .show();
   }
   mRefreshListView.onRefreshComplete();
 }