@Override
  protected String doInBackground(String... params) {
    String message = null, response = null;
    try {
      response =
          MethodSoap.getApproveRejectTimeSheet(
              prefs.getUserID(),
              prjmgrname,
              empid,
              empcode,
              empname,
              empemail,
              projdesc,
              status,
              arraytsid,
              arraytsdid);
      JSONObject jsonobj = new JSONObject(response);
      message = jsonobj.getString("message");
      myresult = jsonobj.getString("DataArr");

    } catch (Exception e) {
      e.printStackTrace();
      flag = 1;
      message = "";
    }

    return message;
  }
 @Override
 protected void onPreExecute() {
   super.onPreExecute();
   connection = new ConnectionDetector(context);
   prefs = AppPreferences.getInstance(context);
   pDialog = new SweetAlertDialog(context, SweetAlertDialog.PROGRESS_TYPE).setTitleText("Loading");
   pDialog.show();
   pDialog.setCancelable(false);
   pDialog.setCanceledOnTouchOutside(false);
 }