Advertisement
Cusy

Untitled

Sep 9th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. boolean flag = false;
  2.  
  3. for (int i = 0; i < constants.MIN_RETRY_AFTER_MASSIVE_UPDATE; i++){
  4.  
  5. for(Zone aZone: zoneList) {
  6. for (Zone oldZone: Singleton.getInstance().getMyZones()){
  7. if (aZone.getId().equals(oldZone.getId()))
  8. flag = aZone.getFlags().charAt(2) != oldZone.getFlags().charAt(2);
  9. }
  10. }
  11.  
  12. if (flag)
  13. break;
  14.  
  15. // do something to make the handler sleep for some seconds
  16.  
  17. }
  18.  
  19. if (flag){
  20. dialog.hide();
  21. dialog.dismiss();
  22. } else {
  23. dialog.hide();
  24. dialog.dismiss();
  25.  
  26. AlertDialog.Builder builder = new AlertDialog.Builder(plantZones.this);
  27.  
  28. // 2. Chain together various setter methods to set the dialog characteristics
  29. builder.setMessage(getString(R.string.operation_error))
  30. .setTitle(getString(R.string.operation_title))
  31. .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
  32. @Override
  33. public void onClick(DialogInterface dialogInterface, int i) {
  34. dialog.hide();
  35. dialog.dismiss();
  36. }
  37. });
  38.  
  39. // 3. Get the AlertDialog from create()
  40. dialog = builder.create();
  41. dialog.show();
  42.  
  43. }
  44. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement