title: Show alert dialog from background process in any activity
body: <p>How to get result of background process in any <code>Activity</code>?</p>
  
  <p>I'm working with OTA update. App handle that in background with handler. When update is done I have to show alert dialog to the user. I can show it in <code>SettingsActivity</code> where I start with OTA but user can be in any other <code>Activity</code>.</p>
  
  <pre><code>private void checkIsUpdated() {
      final Handler handler = new Handler();
      handler.postDelayed(new Runnable() {
          @Override
          public void run() {
              mDevice.getDevice().read(GattUUID.LS_DEVICE_INFORMATION, GattUUID.LC_FIRMWARE, new
                      BleDevice.ReadWriteListener() {
                          @Override
                          public void onEvent(ReadWriteEvent e) {
                              if (e.wasSuccess()) {
  
                                  if (firmwareVersion.equals(e.data_string())) {
                                      showAlertDialog("OTA update failed", "Device is not updated");
  
                                  } else {
                                      showAlertDialog("OTA update is successful.\nDevice is updated to new " +
                                              "firmware!", "Device is updated");
  
                                  }
  
                                  Log.i("OTA", "Read firmware is new success");
                              } else {
                                  Log.e("OTA", "Read firmware is new success");
                              }
                          }
                      });
          }
      }, 30000);
  }
  </code></pre>
  
  <p><code>AlertDialog</code> code</p>
  
  <pre><code> private void showAlertDialog(String message, String title) {
  
      AlertDialog.Builder builder = new AlertDialog.Builder(mContext, R.style.SwipeDialogLight);
      builder.setTitle(title)
              .setMessage(message)
              .setCancelable(false)
              .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      dialog.dismiss();
                  }
  
              });
  
      AlertDialog alert = builder.create();
      if (!alert.isShowing()) {
          alert.show();
      }
  }
  </code></pre>