コード例 #1
0
ファイル: Lights.java プロジェクト: chedisaad/chedi
    @Override
    protected void onPostExecute(String result) {
      // TODO Auto-generated method stub

      if (result.equals("fail")) Toast.makeText(Lights.this, message, Toast.LENGTH_LONG).show();

      if (result.equals("success")) {
        switch (lightImageState) {
          case 0:
            light.setImageResource(R.drawable.light_off);
            break;

          case 1:
            light.setImageResource(R.drawable.light_max);
            break;

          case 2:
            light.setImageResource(R.drawable.light_middle);
            break;

          case 3:
            light.setImageResource(R.drawable.light_low);
            break;

          default:
            break;
        }
      }
      super.onPostExecute(result);
    }
コード例 #2
0
 @Override
 protected void onPostExecute(String result) {
   // doInBackground返回时触发,换句话说,就是doInBackground执行完后触发
   // 这里的result就是上面doInBackground执行后的返回值,所以这里是"执行完毕"
   setTitle(result);
   super.onPostExecute(result);
 }
コード例 #3
0
ファイル: ProfileActivity.java プロジェクト: Sivashankar06/KK
    @Override
    protected void onPostExecute(String response) {
      super.onPostExecute(response);
      Log.d(TAG, "Response : " + response);
      if (response != null) {

        try {
          JSONObject jsonObject = new JSONObject(response);
          boolean isSuccess = jsonObject.getBoolean(Keys.KEY_SUCCESS);

          if (isSuccess) {

            Log.d(TAG, "Profile information Updated");
            Snackbar.make(profileImgView, "Profile information Updated", Snackbar.LENGTH_LONG)
                .setAction("Action", null)
                .show();

          } else {
            Snackbar.make(profileImgView, "Profile information not Updated", Snackbar.LENGTH_LONG)
                .setAction("Action", null)
                .show();
            Log.d(TAG, "Profile information not Updated");
          }
        } catch (JSONException e) {
          e.printStackTrace();
        }
      } else {
        Log.d(TAG, "Update response is NULL");
      }
    }
コード例 #4
0
  @Override
  protected void onPostExecute(String result) {
    // TODO Auto-generated method stub
    super.onPostExecute(result);
    if (pDialog != null) pDialog.dismiss();

    if (result.contains("success")) {
      Util.showToastMessage(Util.mContext, "Payment done successfully", Toast.LENGTH_LONG);
    } else {
      Log.e(TAG, "Error fetching data: " + result);
      Toast.makeText(Util.mContext, result, Toast.LENGTH_LONG).show();
    }

    // Pass value of
    // {"response":"success","cashbackValue":0,"bookingId":246}
    if (mHandler != null) {
      Message msg = Message.obtain();
      Bundle b = new Bundle();
      b.putBoolean("success", true);
      b.putString("jobId", jobId);
      b.putLong("cashBackReturned", cashBackReturned);
      Log.e(TAG, "b: " + b.toString());
      msg.setData(b);
      msg.what = 2;
      mHandler.sendMessage(msg);
      // mHandler.sendEmptyMessage(2);
    }
  }
コード例 #5
0
ファイル: ImageLoader.java プロジェクト: 2249692487/BzuCampus
 @Override
 protected void onPostExecute(Bitmap bitmap) {
   super.onPostExecute(bitmap);
   if (mImageView.getTag().equals(mUrl)) {
     mImageView.setImageBitmap(bitmap);
   }
 }
コード例 #6
0
  @Override
  protected void onPostExecute(Object o) {
    super.onPostExecute(o);
    RespostaParada respostaParada = (RespostaParada) o;
    Parada parada = new Parada();
    parada.setCodigoParada(3333);
    parada.setNome("Parada Teste");
    // respostaParada.setEstaNaParada(false);//Apagar após testes na TelaParada

    if (respostaParada.isEstaNaParada()) {
      notificar(
          Notificacao.CENARIO,
          "Você está em uma parada de ônibus!",
          "Parada:" + " Nome Teste",
          "Cenário detectado: Parada de Ônibus!",
          TelaParada.class,
          parada,
          R.drawable.parada);
      notificar(
          Notificacao.CONDICOES_PARADA,
          "Parada em más condições?",
          "Reclamar das condições da parada!",
          "Más condições da parada de ônibus",
          TelaCondicoesParada.class,
          parada,
          R.drawable.condicoes_parada);
    }
  }
コード例 #7
0
 /**
  * Call all registered notify.
  *
  * @param data Encapsulation class included Bitmap and message string.
  */
 @Override
 protected void onPostExecute(RequestBitmapData data) {
   super.onPostExecute(data);
   for (ActionComplete notify : _complete_notify) {
     notify.onGetBitmapComplete(_is_success, data._bitmap, data._msg);
   }
 }
コード例 #8
0
 @Override
 protected void onPostExecute(Boolean result) {
   super.onPostExecute(result);
   taskLoadFace.showProgress(false);
   if (result) taskLoadFace.onDataLoaded(tasksCursor);
   else taskLoadFace.onError();
 }
コード例 #9
0
ファイル: GpsCameraActivity.java プロジェクト: jx-admin/Code2
    @Override
    protected void onPostExecute(BaseWsResponse result) {
      super.onPostExecute(result);
      proDialog.cancel();
      String resultCode = (String) result.getHashMap().get("result");

      if (null != resultCode && resultCode.equalsIgnoreCase("ok")) {
        DialogUtil.displayWarning(
            activity,
            getString(R.string.sys_msg),
            getString(R.string.photo_upload_successful),
            false,
            null);
        previewImage.setImageBitmap(null);
        deleteOldPhotos(photoRealPath);
        saveSinglePoint("", "");
        savePhoto(photoName, "");
      } else {
        DialogUtil.displayWarning(
            activity,
            getString(R.string.sys_msg),
            getString(R.string.photo_upload_fail),
            false,
            new OnClickListener() {
              @Override
              public void onClick(View v) {}
            });
      }
    }
コード例 #10
0
 @Override
 // when AsyncTask finished
 protected void onPostExecute(Void aVoid) {
   progressDialog.dismiss();
   userCallback.done(null);
   super.onPostExecute(aVoid);
 }
コード例 #11
0
 @Override
 // when AsyncTask finished
 protected void onPostExecute(User returnedUser) {
   progressDialog.dismiss();
   userCallback.done(returnedUser);
   super.onPostExecute(returnedUser);
 }
コード例 #12
0
 @Override
 protected void onPostExecute(Object o) {
   if (DEBUG) {
     Log.v(TAG, "Updating Finished");
   }
   super.onPostExecute(o);
 }
コード例 #13
0
ファイル: home.java プロジェクト: jiang11958/Survey
    @Override
    protected void onPostExecute(String result) {
      // TODO Auto-generated method stub
      super.onPostExecute(result);
      if (pd != null && pd.isShowing()) pd.dismiss();
      if (result != null) {
        Constants.name = "";
        Constants.age = "";
        Constants.gender = "";
        uploadList = db.retriveUpload();

        for (Upload up : uploadList) {
          up.setAge(result);
          up.setName(preference.getString("pid", "1")); // setName(log.getName());//product id
          db.updateUpload(up);
        }
        db.resetTables(MySQLiteHelper.TABLE_NAME);
        uploadList = db.retriveUpload();
        if (uploadList != null && uploadList.size() > 0) {
          showAlert();
        } else
          alert.showAlertDialog(
              home.this, "Warning", "You are not logged in and no data to upload", true);
      } else {
        alert.showAlertDialog(home.this, "Error", "Unable to process server", true);
      }
    }
コード例 #14
0
ファイル: Settings.java プロジェクト: jonathannorman/LocoV2
    @Override
    protected void onPostExecute(String jsonString) {
      super.onPostExecute(jsonString);
      // REMOVE DIALOG
      progressAddSettings.setVisibility(View.INVISIBLE);

      ResultParser resultParser = new ResultParser();
      Result result = resultParser.getParsedResults(jsonString);

      if (result.getError().contains("sucess")) {
        edit.putString(Globals.weight, tvWeight.getText().toString());
        if (genderType.equals(Globals.male)) {
          edit.putString(Globals.gender, Globals.male);
        } else {
          edit.putString(Globals.gender, Globals.female);
        }

        edit.commit();

        Toast toast = Toast.makeText(getApplicationContext(), "Settings added", Toast.LENGTH_LONG);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();

      } else if (result.getError().contains("failed")) {

        Toast toast = Toast.makeText(getApplicationContext(), "Error retry !!", Toast.LENGTH_LONG);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();

      } else {

      }
    }
コード例 #15
0
    @Override
    protected void onPostExecute(Object o) {
      super.onPostExecute(o);

      startActivity(intent);
      finish();
    }
コード例 #16
0
    @Override
    protected void onPostExecute(String s) {
      super.onPostExecute(s);
      List<Movie> movies = MovieJsonParser.parseMovie(s);

      MovieDetailsActivityFragment fragment = mMainActivityFragment.get();
    }
コード例 #17
0
 @Override
 protected void onPostExecute(Bitmap result) {
   super.onPostExecute(result);
   if (movie.getTitle().equals(holder.title.getTag())) {
     holder.poster.setImageBitmap(result);
   }
 }
コード例 #18
0
  @Override
  protected void onPostExecute(String result) {
    super.onPostExecute(result);
    try {
      JSONObject jsonObject = new JSONObject(result);
      JSONArray jsonArray = new JSONArray();
      Iterator iterator = jsonObject.keys();

      while (iterator.hasNext()) {
        String key = (String) iterator.next();
        if (key != "") {
          jsonArray.put(jsonObject.get(key));
          MyCurrencyObject object = new MyCurrencyObject();
          object.setNameId(key);
          object.setFullCountryName(jsonObject.get(key).toString());
          MyCurrencyObjArray.addCurrencyObj(object);
        }
      }
      MainActivity.countriesList.clear();
      for (int i = 0; i < jsonArray.length(); i++) {
        MainActivity.countriesList.add(jsonArray.get(i).toString());
      }
      complete.asyncComplete1(true);
    } catch (JSONException e) {
      e.printStackTrace();
    }
  }
コード例 #19
0
ファイル: UpdateCommentTask.java プロジェクト: kdeplus/YiBo
  @Override
  protected void onPostExecute(Comment result) {
    super.onPostExecute(result);

    if (isShowDialog && dialog != null) {
      try {
        dialog.dismiss();
      } catch (Exception e) {
      }
    }

    if (newComment != null) {
      if (isShowDialog) {
        Toast.makeText(context, R.string.msg_comment_success, Toast.LENGTH_LONG).show();
        Intent intent = new Intent();
        intent.putExtra("RESULT_COMMENT", newComment);
        ((Activity) context).setResult(Constants.RESULT_CODE_SUCCESS, intent);
        ((Activity) context).finish();
      }
    } else {
      if (isShowDialog) {
        Button btnSend = (Button) ((Activity) context).findViewById(R.id.btnOperate);
        btnSend.setEnabled(true);
      }
      Toast.makeText(context, resultMsg, Toast.LENGTH_LONG).show();
    }
  }
コード例 #20
0
ファイル: DroneAnimation.java プロジェクト: romanoncha/Client
  @Override
  protected void onPostExecute(Void result) {
    super.onPostExecute(result);

    MainActivity.map.getOverlays().clear();

    final ArrayList<OverlayItem> items = new ArrayList<OverlayItem>();

    // if (MainActivity.my_lat != 0 && MainActivity.my_lon != 0) {
    OverlayItem myLocationOverlayItem =
        new OverlayItem(
            "Here", "Current Position", new GeoPoint(MainActivity.my_lat, MainActivity.my_lon));
    myLocationOverlayItem.setMarker(MainActivity.myCurrentLocationMarker);
    items.add(myLocationOverlayItem);
    // }

    for (int i = 0; i < MainActivity.drones.size(); i++) {
      OverlayItem droneOverlayItem =
          new OverlayItem(
              "Here",
              "Current Position",
              new GeoPoint(
                  MainActivity.drones.get(i).getLat(), MainActivity.drones.get(i).getLon()));
      droneOverlayItem.setMarker(MainActivity.droneMarker);
      items.add(droneOverlayItem);
    }

    MainActivity.addMarkersOnMap(items);

    DroneAnimation animation = new DroneAnimation();
    animation.execute();
  }
コード例 #21
0
    @Override
    protected void onPostExecute(String result) {
      super.onPostExecute(result);
      Log.d("DownloadData", "Result was: " + result);
      //            xmlTextView.setText(mFileContents);

    }
コード例 #22
0
 @Override
 protected void onPostExecute(HaierResultObject result) {
   super.onPostExecute(result);
   if (isCancelled()) {
     // 通常不走到这里
     onCancelled();
     finish();
     return;
   }
   if (!result.isOpSuccessfully()) {
     MyApplication.getInstance().showMessage(result.mStatusMessage);
     setResult(Activity.RESULT_CANCELED);
   } else if (mAccountObject.hasUid() && mAccountObject.hasId()) {
     // 如果登陆成功
     IMService.connectIMService(LoginOrUpdateAccountDialog.this);
     setResult(Activity.RESULT_OK);
     // 每次登陆,我们都需要注册设备Token
     YouMengMessageHelper.getInstance().saveDeviceTokenStatus(false);
     // 登录成功,我们需要检查是否能够上传设备Token到服务器绑定uid和token
     UpdateService.startCheckDeviceTokenToService(LoginOrUpdateAccountDialog.this);
     // 每次登录我们都重新设置需要重新拉好友列表
     ComPreferencesManager.getInstance().setFirstLaunch(RelationshipActivity.FIRST, true);
   } else {
     MyApplication.getInstance().showMessage(mAccountObject.mStatusMessage);
     setResult(Activity.RESULT_CANCELED);
   }
   finish();
 }
コード例 #23
0
ファイル: SignUpActivity.java プロジェクト: akadevv/GAB
    @Override
    protected void onPostExecute(String aVoid) {
      super.onPostExecute(aVoid);
      // masterInfo 정보 세팅해준다.
      try {
        JSONObject jsonObj = new JSONObject(aVoid);
        JSONArray UserInfoJson = jsonObj.getJSONArray("results");

        for (int i = 0; i < UserInfoJson.length(); i++) {
          JSONObject c = UserInfoJson.getJSONObject(i);
          String userid = c.getString("userid");
          String userphonenum = c.getString("userphonenum");
          String user_name = c.getString("user_name");
          String bank_name = c.getString("bank_name");
          String account_number = c.getString("account_number");

          System.out.println("user id : " + userid);
          System.out.println("user phonenum :" + userphonenum);
          System.out.println("user name :" + user_name);
          masterinfo.setMasterID(userid);
          masterinfo.setMasterName(user_name);
          masterinfo.setMasterPhoneNum(userphonenum);
          masterinfo.setMasterBankName(bank_name);
          masterinfo.setMasterBankNum(account_number);
        }

      } catch (Exception e) {
        e.printStackTrace();
      }
    }
コード例 #24
0
    @Override
    protected void onPostExecute(String s) {
      super.onPostExecute(s);
      Log.d("Spinner", "e onPostExecute---->" + s);
      try {
        JSONArray jsonArray = new JSONArray(s);
        reasonStrings = new String[jsonArray.length() + 1];
        idStrings = new String[jsonArray.length() + 1];

        for (int i = 0; i < jsonArray.length(); i++) {
          if (i == 0) {
            reasonStrings[i] = "--select reason--";
            idStrings[i] = "";
          } else {
            JSONObject jsonObject = jsonArray.getJSONObject(i);
            reasonStrings[i] = jsonObject.getString("res_name");
            idStrings[i] = jsonObject.getString("res_id");
          }
        }

        ArrayAdapter arrayAdapter =
            new ArrayAdapter(context, R.layout.support_simple_spinner_dropdown_item, reasonStrings);
        reason1Spinner.setAdapter(arrayAdapter);
        reason2Spinner.setAdapter(arrayAdapter);

      } catch (Exception e) {
        Log.d("Spinner", "e onPostExecute+++" + e.toString());
      }
    }
コード例 #25
0
 @Override
 protected void onPostExecute(String result) {
   super.onPostExecute(result);
   btn_video.setVisibility(View.VISIBLE);
   mIjkVideoView.setBackgroundDrawable(drawable);
   mProgressBar.setVisibility(View.INVISIBLE);
 }
コード例 #26
0
ファイル: DropsTabFragment.java プロジェクト: Hhwhiskey/riple
 @Override
 protected void onPostExecute(String[] result) {
   // Call setRefreshing(false) when the list has been refreshed.
   mWaveSwipeRefreshLayout.setRefreshing(false);
   mEndlessOnScrollListener.reset(1, 0, true);
   super.onPostExecute(result);
 }
コード例 #27
0
 @Override
 protected void onPostExecute(String s) {
   Log.d(Constants.LOG_KEY, "onPostExecute() -> " + s);
   super.onPostExecute(s);
   respostaParaArrayUsuarios(s);
   this.mProgressDialog.dismiss();
 }
コード例 #28
0
    @Override
    protected void onPostExecute(Void result) {

      sh = getApplicationContext().getSharedPreferences(MY_PREFERENCES, MODE_PRIVATE);
      int sortOrder = sh.getInt("sort_type", 0);
      switch (sortOrder) {
        case 1:
          listadaptor.sortLex();
          break;
        case 2:
          listadaptor.sortLexDesc();
          break;

        case 3:
          listadaptor.sortRating();
          break;

        case 4:
          listadaptor.sortRaingDesc();
          break;

        default:
      }

      setListAdapter(listadaptor);
      progress.dismiss();
      super.onPostExecute(result);
    }
コード例 #29
0
    @Override
    protected void onPostExecute(String s) {
      super.onPostExecute(s);

      // Parse JSON
      try {
        JSONObject jsonObject = new JSONObject(s);
        String status = jsonObject.getString("result");
        if (status.equalsIgnoreCase("success")) {
          errorText.setText("Account Successfully Created!");

          // introduce a small delay to allow for user to know account is created
          Handler h = new Handler();
          h.postDelayed(
              new Runnable() {
                @Override
                public void run() {
                  myDialog.dismiss();
                }
              },
              1500);
        } else {
          String reason = jsonObject.getString("error");
          errorText.setText("Error: " + reason);
        }
      } catch (Exception e) {
        Log.d(TAG, "Parsing JSON Exception " + e.getMessage());
      }
    }
コード例 #30
0
 @Override
 protected void onPostExecute(Void result) {
   super.onPostExecute(result);
   if (pd != null) {
     pd.dismiss();
   }
 }