I would start by using a real MIME type. The ones in your comment are not real MIME types.
On Thu, Dec 2, 2010 at 8:05 AM, Samuh <[email protected]> wrote: > We are downloading a file from a server and writing it to folder on > sdcard. As soon as the write finishes, we perform a Media Scan on that > folder. When the user tries to open the file for viewing, we try to > leverage upon the Intent mechanism of Android and raise an Intent as > follows: > > Intent myIntent = new > Intent(Intent.ACTION_VIEW,Uri.fromFile(tempFile)); > // MIME_TYPE could be either of: image/*, video/*, audio/*, text/* > myIntent.setType(MIME_TYPE); > startActivity(Intent.createChooser(myIntent, "Open file using...")); > > On emulator, the camera Application is launched for this Intent but > the application crashes with NPE. And on MOTOROLA Milestone, we are > getting a Toast which says: "No image to show". Note that the photo is > actually displayed in Media Gallery of both emulator and phone as soon > as the scan finishes. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 3.0.1 Available! -- 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

