On Wed, Mar 23, 2011 at 6:46 AM, akshay goel <xpectro...@gmail.com> wrote: > Thanks Dianne! But I do not understand why this DOES work if the app > registers for VIEW instead of SEND. Is Android able to handle both MIME > types and extensions for VIEW but only MIME types for SEND?
Correct. Let's consider a typical ACTION_SEND with an attachment: Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(whatever)); emailIntent.setType("image/png"); startActivity(emailIntent); The <data> element, in which you are applying the wildcard pattern, is applied to the "data" of the Intent. That is the Uri you supply via the constructor, setData(), or setDataAndType(). However, for ACTION_SEND, there is no data. There is a Uri, but it is in an Intent extra (EXTRA_STREAM), and nothing in an <intent-filter> filters on extras. However, the MIME type is still defined via setType(), regardless of ACTION_SEND vs. ACTION_VIEW. In general, file extensions simply do not work well on Android -- content providers like MediaStore do not supply them in Uris, for example. As Ms. Hackborn indicated, please use MIME types. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.5 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en