Ejemplo n.º 1
0
    @Override
    protected void onPostExecute(String result) {
      this.dialog.dismiss();

      if (result.equals(Boolean.TRUE.toString()) || result.equals(Boolean.FALSE.toString())) {
        HomeScreen.syncInProgress = false;
        HomeScreen.syncComplete = true;
        showBeans();
      } else {
        final AlertDialog dialog =
            ViewHelper.getOkModalWithCloseApp(
                HomeScreen.this, "Sync Failure", "Data Sync Failed. Please restart the App");
        dialog.setButton(
            DialogInterface.BUTTON_POSITIVE,
            "OK",
            new DialogInterface.OnClickListener() {

              public void onClick(DialogInterface dialog, int status) {
                dialog.dismiss();
                HomeScreen.syncInProgress = false;
                HomeScreen.syncComplete = false;
                HomeScreen.this.finish();
              }
            });
        dialog.show();
      }
    }
Ejemplo n.º 2
0
 // Executes on the UI thread. All UI operations are safe. This method is invokes if there is an
 // error during the doAction execution.
 // From an Ajax standpoint, consider this invocation as a UI callback
 public void doViewError(CommandContext commandContext) {
   // Shows an Error Alert
   Activity currentActivity = Services.getInstance().getCurrentActivity();
   ViewHelper.getOkModal(
           currentActivity, "App Error", commandContext.getAppException().getMessage())
       .show();
 }
Ejemplo n.º 3
0
 public void doViewError(CommandContext commandContext) {
   Activity activity = (Activity) commandContext.getAppContext();
   ViewHelper.getOkModalWithCloseApp(
           activity,
           "App Error",
           "The "
               + Constants.channel
               + " is not ready. Please launch the App again in a few minutes")
       .show();
 }
Ejemplo n.º 4
0
    @Override
    protected void onPostExecute(String result) {
      dialog.dismiss();

      if (result != null) {
        ViewHelper.getOkModal(HomeScreen.this, "App Activation Failure", result).show();
      } else {
        handler.sendMessage(message);
      }
    }