title: Show a snackbar from a broadcast receiver?
body: <p>so I am looking to make a tasker plugin that shows a snackbar with user entered text. The problem I am having is that I have to show the snackbar from a broadcast receiver. I thought I found a way by passing the activity context from an activity class, but the app just crashes. All help is much appreciated. </p>
  
  <p>Here is the receiver class:</p>
  
  <pre><code>public final class FireReceiver extends BroadcastReceiver {
  
      Maker maker;
  
      /**
       * @param context {@inheritDoc}.
       * @param intent  the incoming {@link com.twofortyfouram.locale.Intent#ACTION_FIRE_SETTING} Intent. This
       *                should contain the {@link com.twofortyfouram.locale.Intent#EXTRA_BUNDLE} that was saved by
       *                {@link SnackbarActivity} and later broadcast by Locale.
       */
      @Override
      public void onReceive(final Context context, final Intent intent) {
          /*
           * Always be strict on input parameters! A malicious third-party app could send a malformed Intent.
           */
          if (!com.twofortyfouram.locale.Intent.ACTION_FIRE_SETTING.equals(intent.getAction())) {
              if (Constants.IS_LOGGABLE)
                  Log.e(Constants.LOG_TAG, String.format(Locale.US, "Received unexpected Intent action %s", intent.getAction())); //$NON-NLS-1$
              return;
          }
  
          BundleScrubber.scrub(intent);
  
          final Bundle bundle = intent.getBundleExtra(com.twofortyfouram.locale.Intent.EXTRA_BUNDLE);
          BundleScrubber.scrub(bundle);
  
          if (PluginBundleManager.isBundleValid(bundle)) {
              final String message = bundle.getString(PluginBundleManager.BUNDLE_EXTRA_STRING_MESSAGE);
              final String button = bundle.getString(PluginBundleManager.BUNDLE_EXTRA_STRING_BUTTON);
              final String mode = bundle.getString(PluginBundleManager.BUNDLE_EXTRA_STRING_MODE);
              if (maker == null) {
                  maker = new Maker();
              }
              //maker.createSnackbar(message, button, mode);
              Snackbar.make(maker.getView(), message, Snackbar.LENGTH_SHORT).setAction(button, new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
  
                  }
              }).show();
          }
      }
  }
  </code></pre>
  
  <p>Here is the Maker class:</p>
  
  <pre><code>public class Maker extends Activity {
  
      public void createSnackbar(String Main, String Button, String Mode) {
          if (Mode.equals("Short")) {
              Snackbar.make(findViewById(android.R.id.content), Main, Snackbar.LENGTH_SHORT).setAction(Button, new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
  
                  }
              }).show();
          } else {
              Snackbar.make(findViewById(android.R.id.content), Main, Snackbar.LENGTH_LONG).setAction(Button, new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
  
                  }
              }).show();
          }
      }
  
      public View getView() {
          View view = findViewById(android.R.id.content);
          return view;
      }
  }
  </code></pre>