Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. HashMap<String, String> params = new HashMap<>();
  2. params.put(ArST.Cd_AR, Cd_AR);
  3. params.put(ArUbicazioneST.Cd_MG, Cd_MG);
  4. params.put(ArUbicazioneST.Cd_MGUbicazione, Cd_MGUbicazione);
  5. params.put("Cd_MGEsercizio", Cd_Esercizio);
  6. params.put(ArLottoST.Cd_ARLotto, Cd_ARLotto);
  7. params.put("Quantita", String.valueOf(Qta));
  8. params.put(MGMovIntST.Id_MGMovInt, String.valueOf(Id_MGMovInt));
  9. new AsyncTask<HashMap<String, String>, JSONObject, Void>() {
  10. @Override
  11. protected Void doInBackground(HashMap<String, String>... hashMaps) {
  12. HashMap<String, String> params = new HashMap<String, String>();
  13. params = hashMaps[0];
  14. String buffer = HttpConnection.sendDataByPost(URL_INSERT_POST, params);
  15. if (buffer == null) this.cancel(true);
  16. else {
  17. try {
  18. JSONObject object = new JSONObject(buffer);
  19. publishProgress(object);
  20. } catch (JSONException e) {
  21. e.printStackTrace();
  22. }
  23. }
  24. return null;
  25. }
  26.  
  27. @Override
  28. protected void onProgressUpdate(JSONObject... values) {
  29. int MGMov = 0;
  30. try {
  31. MGMov = values[0].getInt("Id_MGMov");
  32. if (MGMov != 0) loadScan.onLoad(true);
  33. else this.cancel(true);
  34. } catch (JSONException e) {
  35. e.printStackTrace();
  36. this.cancel(true);
  37. }
  38.  
  39. super.onProgressUpdate(values);
  40. }
  41. }.execute(params);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement