Example #1
0
  private void sendFeedback() {

    try {
      imm.hideSoftInputFromWindow(mContent.getWindowToken(), 0);
      String content = mContent.getText().toString();
      Logger.i(content);
      if (StringUtils.empty(content)) {
        UIHelper.ToastMessage(getApplicationContext(), "请输入内容", Toast.LENGTH_SHORT);
        return;
      }
      loadingPd = UIHelper.showProgress(this, null, null, true);
      AppClient.sendFeedback(
          appContext,
          content,
          new ClientCallback() {
            @Override
            public void onSuccess(Entity data) {
              UIHelper.dismissProgress(loadingPd);
              show1OptionsDialog(oprators);
            }

            @Override
            public void onFailure(String message) {
              UIHelper.dismissProgress(loadingPd);
              UIHelper.ToastMessage(getApplicationContext(), message, Toast.LENGTH_SHORT);
            }

            @Override
            public void onError(Exception e) {
              UIHelper.dismissProgress(loadingPd);
              Logger.i(e);
              UIHelper.ToastMessage(getApplicationContext(), "网络不给力", Toast.LENGTH_SHORT);
            }
          });
    } catch (Exception e) {
      Logger.i(e);
    }
  }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.tabbar);
   ShareSDK.initSDK(this);
   AppManager.getAppManager().addActivity(this);
   mainTab = (RadioGroup) findViewById(R.id.main_tab);
   mainTab.setOnCheckedChangeListener(this);
   prepareIntent();
   setupIntent();
   RadioButton homebutton = (RadioButton) findViewById(R.id.radio_button1);
   homebutton.setChecked(true);
   appContext = (MyApplication) getApplication();
   if (!appContext.isNetworkConnected()) {
     UIHelper.ToastMessage(getApplicationContext(), "当前网络不可用,请检查你的网络设置", Toast.LENGTH_SHORT);
     return;
   }
   checkLogin();
 }
  private void checkLogin() {
    loadingPd = UIHelper.showProgress(this, null, null, true);
    AppClient.autoLogin(
        appContext,
        new ClientCallback() {
          @Override
          public void onSuccess(Entity data) {
            UIHelper.dismissProgress(loadingPd);
            UserEntity user = (UserEntity) data;
            switch (user.getError_code()) {
              case Result.RESULT_OK:
                appContext.saveLoginInfo(user);
                //					getUnReadMessage();
                //					if (!Utils.hasBind(getApplicationContext())) {
                //						blindBaidu();
                //					}
                break;
              default:
                UIHelper.ToastMessage(
                    getApplicationContext(), user.getMessage(), Toast.LENGTH_SHORT);
                showLogin();
                break;
            }
          }

          @Override
          public void onFailure(String message) {
            UIHelper.dismissProgress(loadingPd);
            UIHelper.ToastMessage(getApplicationContext(), message, Toast.LENGTH_SHORT);
          }

          @Override
          public void onError(Exception e) {
            UIHelper.dismissProgress(loadingPd);
            ((AppException) e).makeToast(getApplicationContext());
          }
        });
  }
Example #4
0
 public void onClick(View v) {
   String content = mContent.getText().toString();
   if (StringUtils.notEmpty(content)) {
     UIHelper.showClearWordsDialog(v.getContext(), mContent, mNumberwords);
   }
 }