title: ACTION_SEND crash Activity with grantUriPermission Error
body: <p>When i call ACTION_SEND this show a share box but activity is closed with error</p>
  
  <pre><code>try {
              SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
              String link = preferences.getString("speed", "");
              Intent i = new Intent(Intent.ACTION_SEND);
              i.setType("text/plain");
              i.putExtra(Intent.EXTRA_SUBJECT, "subject");
              String sAux = "\nText:\n\n";
              sAux = sAux + link + "\n\n";
              i.putExtra(Intent.EXTRA_TEXT, sAux);
              startActivity(Intent.createChooser(i, "Share Link"));
          } catch (Exception e) {
              e.toString();
          }
  </code></pre>
  
  <p>And i have configured the Activity with this:</p>
  
  <pre><code>&lt;activity android:name=".Settings" android:screenOrientation="portrait" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.SEND" /&gt;
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
                  &lt;data android:mimeType="text/plain" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  </code></pre>
  
  <p>The full error code is:</p>
  
  <pre><code>  W/Intent: Failure when grantUriPermission
        java.lang.NullPointerException: Attempt to invoke virtual method 'void android.net.Uri.writeToParcel(android.os.Parcel, int)' on a null object reference
            at android.app.ActivityManagerProxy.grantUriPermission(ActivityManagerNative.java:4830)
            at android.content.Intent.migrateExtraStreamToClipData(Intent.java:9195)
            at android.app.Instrumentation.execStartActivity(Instrumentation.java:1529)
            at android.app.Activity.startActivityForResult(Activity.java:4391)
            at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)
            at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:67)
            at android.app.Activity.startActivityForResult(Activity.java:4335)
            at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:720)
            at android.app.Activity.startActivity(Activity.java:4697)
            at android.app.Activity.startActivity(Activity.java:4665)
            at test.app.Settings.Share(Settings.java:56)
            at java.lang.reflect.Method.invoke(Native Method)
            at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)
            at android.view.View.performClick(View.java:5647)
            at android.view.View$PerformClick.run(View.java:22465)
            at android.os.Handler.handleCallback(Handler.java:761)
            at android.os.Handler.dispatchMessage(Handler.java:98)
            at android.os.Looper.loop(Looper.java:156)
            at android.app.ActivityThread.main(ActivityThread.java:6577)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
            at android.app.ActivityManagerProxy.grantUriPermission(ActivityManagerNative.java:4830)
  </code></pre>
  
  <p>At line 56 i have: <code>startActivity(Intent.createChooser(i, "Share Link"));</code></p>
  
  <p>Activity is closed but i still see a share box.</p>
  
  <p>Thanks for any help, if you need other information write a comment</p>