Okay I am going to say once more, and I am done with this thread: do not do this. Your app -will- break on different devices. You have been warned. Please don't complain about having to deal with your app breaking when it does, because you are making assumptions about very fragile implementations, and it definitely will break.
There is not currently an API to "launch the gallery app." I don't think we want to have such a thing, because I don't think there being "a gallery app" kind of thing makes sense as part of the generic Android platform APIs. On Thu, Nov 26, 2009 at 6:57 PM, pcm2a <[email protected]> wrote: > I don't need to start up one image, what I need to start up is the > gallery application. I'm not wanting to choose one image or return an > image back to my application. I just want the gallery app to start up > just like you clicked the icon. > > I do have some good news that I have figured out a way to actually > start it up, but not only do I have to use class names, I have also > check if it is a Hero or a non-Hero. > This line starts up the Gallery app on a non Hero phone (could be > different once the Acer A1 or Sony X10 comes out): > intent.setClassName("com.android.camera", > "com.android.camera.GalleryPicker"); > This line starts up the Gallery app on a Hero phone: > intent.setClassName("com.htc.album", > "com.htc.album.AlbumTabSwitchActivity"); > > I've poached a method i found on another forum that lets me check > which activity will work with this: > List<ResolveInfo> list = context.getPackageManager > ().queryIntentActivities(intent, > PackageManager.MATCH_DEFAULT_ONLY); > > With this I now have a way for my users to start up the native gallery > app from my application. This has been asked a tremendous amount by > my users and I'm excited to deliver it to them. We both know that > hard coding class names in is not the best method but if there is no > other alternative, then that is just how it must be for now. > > On Nov 26, 7:59 pm, Dianne Hackborn <[email protected]> wrote: > > It doesn't even work today, because different devices have the "gallery" > > implemented in different places. DO NOT USE PACKAGE NAMES. The only > > supported way to launch other applications is through the officially > > published intent protocols, such as VIEW with an image to show an image. > > > > > > -- > 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]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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

