@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); }
@Override protected void onPostExecute(String result) { // doInBackground返回时触发,换句话说,就是doInBackground执行完后触发 // 这里的result就是上面doInBackground执行后的返回值,所以这里是"执行完毕" setTitle(result); super.onPostExecute(result); }
@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"); } }
@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); } }
@Override protected void onPostExecute(Bitmap bitmap) { super.onPostExecute(bitmap); if (mImageView.getTag().equals(mUrl)) { mImageView.setImageBitmap(bitmap); } }
@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); } }
/** * 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); } }
@Override protected void onPostExecute(Boolean result) { super.onPostExecute(result); taskLoadFace.showProgress(false); if (result) taskLoadFace.onDataLoaded(tasksCursor); else taskLoadFace.onError(); }
@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) {} }); } }
@Override // when AsyncTask finished protected void onPostExecute(Void aVoid) { progressDialog.dismiss(); userCallback.done(null); super.onPostExecute(aVoid); }
@Override // when AsyncTask finished protected void onPostExecute(User returnedUser) { progressDialog.dismiss(); userCallback.done(returnedUser); super.onPostExecute(returnedUser); }
@Override protected void onPostExecute(Object o) { if (DEBUG) { Log.v(TAG, "Updating Finished"); } super.onPostExecute(o); }
@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); } }
@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 { } }
@Override protected void onPostExecute(Object o) { super.onPostExecute(o); startActivity(intent); finish(); }
@Override protected void onPostExecute(String s) { super.onPostExecute(s); List<Movie> movies = MovieJsonParser.parseMovie(s); MovieDetailsActivityFragment fragment = mMainActivityFragment.get(); }
@Override protected void onPostExecute(Bitmap result) { super.onPostExecute(result); if (movie.getTitle().equals(holder.title.getTag())) { holder.poster.setImageBitmap(result); } }
@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(); } }
@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(); } }
@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(); }
@Override protected void onPostExecute(String result) { super.onPostExecute(result); Log.d("DownloadData", "Result was: " + result); // xmlTextView.setText(mFileContents); }
@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(); }
@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(); } }
@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()); } }
@Override protected void onPostExecute(String result) { super.onPostExecute(result); btn_video.setVisibility(View.VISIBLE); mIjkVideoView.setBackgroundDrawable(drawable); mProgressBar.setVisibility(View.INVISIBLE); }
@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); }
@Override protected void onPostExecute(String s) { Log.d(Constants.LOG_KEY, "onPostExecute() -> " + s); super.onPostExecute(s); respostaParaArrayUsuarios(s); this.mProgressDialog.dismiss(); }
@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); }
@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()); } }
@Override protected void onPostExecute(Void result) { super.onPostExecute(result); if (pd != null) { pd.dismiss(); } }