コード例 #1
0
  @Override
  public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId()) {
      case R.id.adialogOkButton:
        if (Settings.frmSettingflag == true) {
          try {
            DatabaseHelper db = new DatabaseHelper(mActivity);
            String strQuery = "Select OfflineFlag from CS_OfflineCount";
            Cursor cur = db.getData(strQuery);
            int cnt = cur.getCount();

            if (cur.getCount() > 0) {
              if (Utility.isNetworkAvailable(mActivity)) {
                for (int l = 0; l < cnt; l++) {
                  cur.moveToNext();
                  oflcnt = Integer.parseInt(cur.getString(0).toString());
                  try {
                    new SoapAccessTask_SaveFeedback().execute();

                  } catch (Exception e) {
                    e.printStackTrace();
                  }
                }
              }
              cur.close();
              db.CloseDB();
            }
          } catch (Exception e) {
            e.printStackTrace();
          }
          // mActivity.finish();
          // dismiss();
        } else if (SplashActivity.deviceIsActive == 0) {
          if (offlineCount > 0) {
            // go to settings class
            fromAlert = true;
            Settings.offlinExpiredflag = true;
            mActivity.finish();
            Intent myIntent = new Intent(mActivity, Settings.class);
            mActivity.startActivity(myIntent);
            dismiss();
          } else {
            mActivity.finish();
            break;
          }
        } else {
          mActivity.finish();
          break;
        }

      default:
        break;
    }
    dismiss();
  }