OSDN Git Service

T27950
authorYuji Konishi <yuji.k64613@gmail.com>
Thu, 29 Mar 2012 09:18:18 +0000 (18:18 +0900)
committerYuji Konishi <yuji.k64613@gmail.com>
Thu, 29 Mar 2012 09:18:18 +0000 (18:18 +0900)
workspace/EverMemo/src/com/yuji/em/task/UpdateNoteTask.java

index 97e15f9..bdb9613 100644 (file)
@@ -15,8 +15,6 @@ public class UpdateNoteTask implements AsyncTaskIF {
        public static final int ERROR_NOT_FOUND = 1;
        public static final int ERROR_SYSTEM = 9;
 
-       private static int RETRY_COUNT = 3;
-
        private Context context = null;
        private String guid;
        private String noteName;
@@ -37,35 +35,22 @@ public class UpdateNoteTask implements AsyncTaskIF {
 
        @Override
        public void doExecute() {
-               Note note = null;
                try {
-                       int i = 0;
                        synchronized (context) {
-                               for (i = 0; i < RETRY_COUNT; i++) {
-                                       note = util.updateNoteContext(guid, title, text);
-                                       if (note != null) {
-                                               NoteDao dao = NoteDao.getInstance();
-                                               com.yuji.em.data.Note n = new com.yuji.em.data.Note(
-                                                               note.getGuid(), note.getTitle());
-                                               dao.update(context, n);
-
-                                               break;
-                                       }
-                                       Debug.d(this, "retry updateNoteContext()"); // TODO
-                                       try {
-                                               Thread.sleep(1000);
-                                       } catch (InterruptedException e) {
-                                               ;
-                                       }
+                               Note note = util.updateNoteContext(guid, title, text);
+                               if (note != null) {
+                                       NoteDao dao = NoteDao.getInstance();
+                                       com.yuji.em.data.Note n = new com.yuji.em.data.Note(
+                                                       note.getGuid(), note.getTitle());
+                                       dao.update(context, n);
+                                       status = ERROR_NONE;
+                               } else {
+                                       Toast.makeText(context, "\8f\91\82«\8d\9e\82Ý\82É\8e¸\94s\82µ\82Ü\82µ\82½" + text,
+                                                       Toast.LENGTH_LONG); // TODO
+                                       Debug.d(this, "doExecute"); // TODO
+                                       status = ERROR_SYSTEM;
                                }
                        }
-                       if (i < RETRY_COUNT) {
-                               status = ERROR_NONE;
-                       } else {
-                               Toast.makeText(context, "\8f\91\82«\8d\9e\82Ý\82É\8e¸\94s\82µ\82Ü\82µ\82½" + text, Toast.LENGTH_LONG); // TODO
-                               Debug.d(this, "doExecute"); // TODO
-                               status = ERROR_SYSTEM;
-                       }
                } catch (EDAMNotFoundException e) {
                        status = ERROR_NOT_FOUND;
                }