Пример #1
0
 @Override
 public void onPostExecute(Integer result) {
   if (result == RESULT_OK) {
     if (dashboardList.size() == 0) {
       dashboardActivity.setEmptyView(View.VISIBLE);
     } else {
       if (items.size() > 0) {
         dashboardActivity.setAdapter(items);
         dashboardActivity.setEmptyView(View.GONE);
       } else dashboardActivity.setEmptyView(View.VISIBLE);
     }
   } else if (result == RESULT_ERROR) {
     dashboardActivity.setEmptyView(View.VISIBLE);
     WarningDialog dialog =
         new WarningDialog(dashboardActivity, titleString, contentString, okString);
     dialog.show();
   } else if (result == RESULT_TIMEOUT) {
     new ConnTimeOutDialog(dashboardActivity, titleString, okString).show();
   }
   ExoUtils.setLoadingItem(loaderItem, false);
   String strGadgetsErrorList = dashboardController.getGadgetsErrorList();
   if (strGadgetsErrorList.length() > 0) {
     StringBuffer titleBuffer = new StringBuffer("Apps: ");
     titleBuffer.append(strGadgetsErrorList);
     titleBuffer.append(" ");
     titleBuffer.append(contentString);
     WarningDialog dialog =
         new WarningDialog(dashboardActivity, titleString, titleBuffer.toString(), okString);
     dialog.show();
   }
 }
  @Override
  public void onPostExecute(String[] result) {

    if (result != null) {
      SocialServiceHelper.getInstance().userIdentity = mUserIdentity;
      SocialServiceHelper.getInstance().activityService = mActivityService;
      SocialServiceHelper.getInstance().identityService = mIdentityService;
      SocialServiceHelper.getInstance().spaceService = mSpaceService;
      SocialServiceHelper.getInstance().userProfile = result;
      if (HomeActivity.homeActivity != null) {
        HomeActivity.homeActivity.setProfileInfo(result);
      }
      if (AccountSetting.getInstance().shouldSaveProfileInfo(result[1], result[0])) {
        SettingUtils.persistServerSetting(mContext);
      }

      /** Load activities for view flipper */
      homeController.onLoad(ExoConstants.HOME_SOCIAL_MAX_NUMBER, HomeController.FLIPPER_VIEW);

    } else {
      loaderItem.setLoading(false);
      WarningDialog dialog = new WarningDialog(mContext, titleString, contentString, okString);
      dialog.show();
    }
  }