@Override protected void onPostExecute(Integer result) { Log.i(Prefs.TAG, "onPostExecute"); progressDialog.dismiss(); super.onPostExecute(result); // finished Toast String rc = null; if (commandValidationFailedFlag) { rc = "Command Vaidation Failed"; } else { rc = GeneralUtils.getReturnCodeFromLog(vkLogPath); } final String status = rc; CompressSimple.this.runOnUiThread( new Runnable() { public void run() { Toast.makeText(CompressSimple.this, status, Toast.LENGTH_LONG).show(); if (status.equals("Transcoding Status: Failed")) { Toast.makeText( CompressSimple.this, "Check: " + vkLogPath + " for more information.", Toast.LENGTH_LONG) .show(); } } }); }