/** * Updates the UI based on the result of the loading/alignment stage. * * @param success */ public void updateUI(boolean success, String errorMessage) { Log.i(LOG_TAG, "errorMessage:" + errorMessage); if (success) { ScanUtils.displayImageInWebView( (WebView) findViewById(R.id.webview), ScanUtils.getAlignedPhotoPath(photoName)); } else { RelativeLayout failureMessage = (RelativeLayout) findViewById(R.id.failureContainer); failureMessage.setVisibility(View.VISIBLE); if (errorMessage != null && errorMessage.length() > 0) { ((TextView) findViewById(R.id.failureMessage)).setText(errorMessage); } } content.setVisibility(View.VISIBLE); processButton.setEnabled(success); }