Thanks Mark, much appreciated, that works. Just to let you
"com.google.android.gallery3d" is the package name, but for some
reason simply calling setPackage() on the intent works for some
packages but not others. Now, that I know the issue, I suppose
"Application is not installed" makes sense, although it would be nice
if it could resolve to a more meaningful message.

John


On Aug 6, 4:32 am, Mark Murphy <mmur...@commonsware.com> wrote:
> On Sat, Aug 6, 2011 at 1:46 AM, John <android...@gmail.com> wrote:
> > In the case of the Gallery application i.e.
> > "com.google.android.gallery3d", which throws the "Application is not
> > installed" error in the shortcut, it shows up both in
> > getInstalledPackages and also in queryIntentActivities with the given
> > Intent, also it only has one entry in the queryIntentActivities which
> > confuses me even more. If it had more than one entry, that would make
> > sense to me, I would need to specify which className to invoke.
>
> com.google.android.gallery3d doesn't exist in the Android open source
> project (at least Google Code Search doesn't turn it up), and the
> Gallery3D project doesn't use that package.
>
> Have you tried creating a shortcut based on the actual ResolveInfo
> object? Here's the code snippet for creating such an Intent:
>
> Intent buildLauncherIntent(ResolveInfo launchable) {
>                 ActivityInfo activity=launchable.activityInfo;
>                 ComponentName name=new 
> ComponentName(activity.applicationInfo.packageName,
>                                                                               
>                            activity.name);
>                 Intent i=new Intent(Intent.ACTION_MAIN);
>
>                 i.addCategory(Intent.CATEGORY_LAUNCHER);
>                 i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
>                                                                 
> Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
>                 i.setComponent(name);
>
>                 return(i);
>
> }
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ 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

Reply via email to