Either the documentation for ACTION_SEND is wrong or there is a bug
with sending intents with a MIME type of */*.

The ACTION_SEND documentation says that when sending this intent, to
"use */* if the MIME type is unknown (this will only allow senders
that can handle generic data streams)."  However, if you do this,
instead of only getting the activities and such that support generic
streams (i.e. only the ones that support "*/*"), you get everyone who
supports ACTION_SEND in any way.  This includes many activities that
don't support */* and only supports specific types (such as text/plain
or image/jpeg).

This results in crashes or other strange behavior.  The chooser will
display many apps who are not written to handle generic data (and have
declared so in their AndroidManifest.xml files).  When the user
selects some of these apps, they crash.  For example, Google Goggles
crashes when I select it in the chooser.

What I expect to happen is for the ACTION_SEND documentation to be
right: if I am sending an Intent with generic data (type = */*), then
the chooser should ONLY show the activities that support generic data.

Here's some sample code
                    Intent sendIntent = new
Intent(Intent.ACTION_SEND);
                    sendIntent.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile( filePath ));
                    sendIntent.putExtra(Intent.EXTRA_SUBJECT,
"Hello" );
                    sendIntent.setType("*/*");
                    startActivity( Intent.createChooser( sendIntent,
"Select how to share the file:") );

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to