title: test the call to Intent.ACTION_SEND
body: <p>I have a menu item that when clicked, call the <code>ACTION_SEND</code>, like this</p>
  
  <pre><code>public static void shareToGMail(Context context, String subject, String content) {
      Intent emailIntent = new Intent(Intent.ACTION_SEND);
      emailIntent.putExtra(Intent.EXTRA_EMAIL, Constants.FEEDBACK_EMAIL);
      emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
      emailIntent.setType("text/plain");
      emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, content);
  
      // Attach Debug log:
      File dataDirectory = context.getExternalFilesDir(null);
      File logFile = new File(dataDirectory, Constants.LOG_FILENAME);
      if (logFile.exists() &amp;&amp; logFile.canRead()) {
          Uri uri = Uri.parse("file://" + logFile);
          emailIntent.putExtra(Intent.EXTRA_STREAM, uri);
      } else {
          Timber.e("Could not attach Debug file, file " + Constants.BAMBAM_LOG_FILENAME + " does not exist or cannot be read");
      }
  
      final PackageManager pm = context.getPackageManager();
      final List&lt;ResolveInfo&gt; matches = pm.queryIntentActivities(emailIntent, 0);
      ResolveInfo best = null;
      for (final ResolveInfo info : matches)
          if (info.activityInfo.packageName.endsWith(".gm") || info.activityInfo.name.toLowerCase().contains("gmail"))
              best = info;
      if (best != null)
          emailIntent.setClassName(best.activityInfo.packageName, best.activityInfo.name);
      context.startActivity(emailIntent);
  }
  </code></pre>
  
  <p>I'm trying to test this, with this code</p>
  
  <pre><code>    @Override
      @Before
      public void setUp() throws Exception {
          super.setUp();
          injectInstrumentation(InstrumentationRegistry.getInstrumentation());
          getActivity();
      }
  
      @Test
      public void testFeedback(){
          try {
              openDrawer(R.id.drawer_layout);
              onView(withId(R.id.drawer_layout)).check(matches(isOpen()));
  
              IntentFilter intentFilter = new IntentFilter();
              intentFilter.addAction(Intent.ACTION_SEND);
  //            intentFilter.addDataType("text/plain");
  
              Instrumentation.ActivityMonitor receiverActivityMonitor = getInstrumentation().addMonitor(intentFilter, null, false);
  
              onView(allOf(withText(R.string.report_issues))).perform(click());
              Activity sendActivity = receiverActivityMonitor.waitForActivityWithTimeout(1000);
  
              assertNotNull(sendActivity);
          } catch (Exception e) {
              e.printStackTrace();
              fail();
          }
      }
  </code></pre>
  
  <p>but I get <code>NoActivityResumedException: No activities in stage RESUMED. Did you forget to launch the activity</code>, but I'm calling <code>getActivity()</code> on my setup method...what is missing?</p>