Leaked IntentReceiver from sharing menu
<p>I'm opening the send menu from a button click in a particular activity:</p>

<pre><code>Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_TEXT, "meh");
try {
    startActivity(Intent.createChooser(i, "pfft"));
} ...
</code></pre>

<p>Works fine, but when hitting "Back" to close it, logcat says</p>

<p><code>Activity com.android.internal.app.ChooserActivity has leaked IntentReceiver com.android.internal.app.ResolverActivity$1@405ab288 that was originally registered here. Are you missing a call to unregisterReceiver()?</code></p>

<p>Nothing else happens - the app continues to run without a problem.</p>

<p>Searching says that apparently the above code has registered a BroadcaseReceiver and it needs to be unregistered (via unregisterReceiver), probably during onResume (or onPause).  The signature for unregister receiver says the single argument should be a BroadcastReceiver instance (makes sense).</p>

<p>My question is - where is the reference to the BroadcastReceiver?  AFAICT the methods used to open the menu don't return a BroadcastReceiver - how do I find and reference the appropriate one to unregister it?</p>

<p>TYIA</p>

<p>(should note that I'm debuging on a Samsung Galaxy SII, and <a href="http://stackoverflow.com/questions/7526136/sprint-samsung-galaxy-s2-activity-has-leaked-intentreceiver-are-you-missing">this thread</a> indicates it might be a device-specific bug?)</p>
