예제 #1
0
 // can use UI thread here
 protected void onPreExecute() {
   try {
     this.dialog.setMessage("Загрузка истории репутации...");
     this.dialog.show();
   } catch (Exception ex) {
     Log.e(null, ex);
   }
 }
예제 #2
0
    @Override
    protected Boolean doInBackground(String... params) {
      try {

        return Client.INSTANCE.logout();
      } catch (Exception e) {
        Log.e(mContext, e);
        ex = e;
        return false;
      }
    }
예제 #3
0
    // can use UI thread here
    protected void onPostExecute(final Boolean success) {
      if (this.dialog.isShowing()) {
        this.dialog.dismiss();
      }
      doOnUserChangedListener(m_Login, success);

      if (success) {
        Toast.makeText(mContext, "Выход выполнен", Toast.LENGTH_SHORT).show();
      } else {
        if (ex != null) Log.i(mContext, ex);
      }
    }
예제 #4
0
    // can use UI thread here
    protected void onPostExecute(final Boolean success) {
      try {
        if (this.dialog.isShowing()) {
          this.dialog.dismiss();
        }
      } catch (Exception ex) {
        Log.e(null, ex);
      }

      if (success) {
        m_Adapter.notifyDataSetChanged();
      } else {
        if (ex != null) Log.e(ReputationActivity.this, ex);
        else Toast.makeText(mContext, "Неизвестная ошибка", Toast.LENGTH_SHORT).show();
      }
      txtLoadMoreThemes.setText("Всего: " + m_Reputations.getMaxCount());
      int loadMoreVisibility =
          m_Reputations.getMaxCount() > m_Reputations.size() ? View.VISIBLE : View.GONE;
      txtPullToLoadMore.setVisibility(loadMoreVisibility);
      imgPullToLoadMore.setVisibility(loadMoreVisibility);
      txtFroum.setText(m_Reputations.description);
      listView.onRefreshComplete();
    }
예제 #5
0
 // can use UI thread here
 protected void onPostExecute(final Boolean success) {
   if (this.dialog.isShowing()) {
     this.dialog.dismiss();
   }
   doOnUserChangedListener(m_Login, success);
   Client.INSTANCE.doOnUserChangedListener(m_Login, success);
   if (success) {
     Toast.makeText(mContext, "Вход выполнен", Toast.LENGTH_SHORT).show();
   } else {
     if (ex != null) Log.e(mContext, ex);
     else
       new AlertDialog.Builder(mContext)
           .setIcon(R.drawable.icon)
           .setTitle("Ошибка")
           .setMessage(Client.INSTANCE.getLoginFailedReason())
           .setPositiveButton(android.R.string.ok, null)
           .create()
           .show();
   }
 }