コード例 #1
0
 @Override
 protected void onCancelled() {
   toggleMenu(SYNC_ALL);
   RapidFtrApplication.getApplicationInstance()
       .cancelNotification(recordSyncService.getNotificationId());
   RapidFtrApplication.getApplicationInstance().setSyncTask(null);
 }
コード例 #2
0
 @Override
 protected void onProgressUpdate(String... values) {
   RapidFtrApplication.getApplicationInstance()
       .showNotification(
           recordSyncService.getNotificationId(),
           recordSyncService.getNotificationTitle(),
           values[0]);
 }
コード例 #3
0
 protected void setProgressAndNotify(String statusText, int progress) {
   if (!isCancelled()) {
     RapidFtrApplication.getApplicationInstance()
         .showProgressNotification(
             recordSyncService.getNotificationId(),
             context.getString(R.string.sync_title),
             statusText,
             maxProgress,
             progress,
             false);
   }
 }
コード例 #4
0
 @Override
 protected void onPostExecute(Boolean result) {
   toggleMenu(SYNC_ALL);
   RapidFtrApplication.getApplicationInstance().setSyncTask(null);
   if (result) {
     RapidFtrApplication.getApplicationInstance()
         .showNotification(
             recordSyncService.getNotificationId(),
             recordSyncService.getNotificationTitle(),
             successMessage);
     Toast.makeText(
             RapidFtrApplication_.getApplicationInstance(), successMessage, Toast.LENGTH_LONG)
         .show();
   } else {
     Toast.makeText(
             RapidFtrApplication_.getApplicationInstance(),
             RapidFtrApplication_.getApplicationInstance().getString(R.string.sync_error),
             Toast.LENGTH_LONG)
         .show();
   }
 }