The is a home screen sample code in the SDK.  I would suggest using that
that to see how to do things.

On Thu, Mar 12, 2009 at 8:45 AM, bklik <[email protected]> wrote:

>
> Update:
>
> OK, I can get my application to launch another application if I
> explicitly type in the package and class names.  For example:
>
> Intent i = new Intent();
> i.setClassName("com.android.calculator2",
> "com.android.calculator2.Calculator");
> startActivity(i);
>
> Now, how to do find out what the Activity Name is for each package?  I
> only guessed "Calculator" in the example above after a couple tries.
> I also tried:
>
> appList.get(0).getClassName;
>
> But, it returns null.
>
> Brenton
>
>
>
> On Mar 12, 8:21 am, bklik <[email protected]> wrote:
> > I want to basically create an application launcher.  How do do this?
> > Shouldn't the following just work?
> >
> >         PackageManager pm = this.getPackageManager();
> >         List<ApplicationInfo> appList = pm.getInstalledApplications
> > (0);
> >
> >         Intent i = new Intent();
> >         i.setAction(appList.get(15).packageName);
> >         i.setClassName(appList.get(15).packageName, appList.get
> > (15).className);
> >         startActivity(i);
> >
> > It just crashes and I don't know why.
> >
> > Brenton
> >
>


-- 
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.  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
-~----------~----~----~----~------~----~------~--~---

Reply via email to